我正在学习做出反应,终极版和我有这样进出口减速与之反应,终极版
const todoApp = combineReducers({
todos,
visibilityFilter
})
export default todoApp /*from reducers*/
一个例子吧我有
import reducer from './reducers'
const store = createStore(reducer)
render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root')
)
所以,它没有任何出口作为./reducers中的缩减器,并且ES6中的语法导入不是import * as reducer
。它为什么有效?
是的,但是我的项目中没有文件缩减器。只有一个名为redurs的文件夹,那么./reducers在这里是什么? –
**这代码下面必须写在一些文件中,哪个文件是** '常量todoApp = combineReducers({ 待办事项, visibilityFilter }) 出口默认todoApp' **结合减速器用于结合你的项目中的所有reducer返回一个reducer,它是所有reducer的组合,在你的情况下它是todoApp ** –