Reducer "index" returned undefined during initialization.
ant design项目 启动报错
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
Error: Reducer "index" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.
The above error occurred in the <DvaContainer> component:
in DvaContainer
Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
reducer的函数参数中给state赋一个初值,即state={}