gpt4 book ai didi

javascript - 未捕获的 TypeError : (0 , _store.configureStore) 不是函数

转载 作者:数据小太阳 更新时间:2023-10-29 06:15:06 25 4
gpt4 key购买 nike

<分区>

商店.js

import {createStore, applyMiddleware} from 'redux';
import createLogger from 'redux-logger';
import rootReducer from './reducers/index';

const logger = createLogger();

const createStoreWithMiddleware = applyMiddleware(logger)(createStore);

export default function configureStore(initialState) {
return createStoreWithMiddleware(rootReducer, initialState);
}

索引.js

import React from 'react';
import ReactDOM from 'react-dom';
import TrackList from './components/TrackList';
import {configureStore} from './store';
import * as actions from './actions';

const tracks = [
{
id: 1,
title: 'Title 1'
},
{
id: 2,
title: 'Title 2'
}
];

const store = configureStore();
store.dispatch(actions.setTracks(tracks));

ReactDOM.render(
<TrackList />,
document.getElementById('app')
);

文件夹src由index.js和store.js组成

显示消息 Uncaught TypeError: (0 , _store.configureStore) is not a function when F12

帮帮我谢谢

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com