reactjs - (0 , _react.useEffect) 不是 Docker-compose 中 Storybook 的函数
问题描述
我使用 docker 和 docker-compose 来开发我的网站。它有一个使用 Storybook 管理内部组件的容器。当我查看“表单”主题时,它说:
TypeError: (0 , _react.useEffect) is not a function
at LabelMapperComonent (http://localhost:7006/static/preview.bundle.js:68174:24)
at mountIndeterminateComponent (http://localhost:7006/static/preview.bundle.js:42312:15)
at beginWork (http://localhost:7006/static/preview.bundle.js:42716:16)
at performUnitOfWork (http://localhost:7006/static/preview.bundle.js:45552:16)
at workLoop (http://localhost:7006/static/preview.bundle.js:45581:26)
at renderRoot (http://localhost:7006/static/preview.bundle.js:45612:9)
at performWorkOnRoot (http://localhost:7006/static/preview.bundle.js:46187:24)
at performWork (http://localhost:7006/static/preview.bundle.js:46108:9)
at performSyncWork (http://localhost:7006/static/preview.bundle.js:46085:5)
at requestWork (http://localhost:7006/static/preview.bundle.js:45985:7)
我观察发现是什么原因,我发现错误是这部分:
const LabelMapperComonent = ({ addField, name, label }) => {
useEffect(
() => {
addField({ [name]: label })
},
[name, label]
)
return null
}
我认为这也会导致问题。
export const LabelMapper = connect(null, bindActionCreators.bind(null, { addField }))(LabelMapperComonent)
我出了什么问题,有什么办法解决吗?谢谢你的建议。
解决方案
推荐阅读
- java - 如何从安卓应用中删除谷歌地图?
- c# - 如何使实体框架对每条记录使用 1 个更新查询而不是 1 个?
- android - 找不到 com.github.ybq:Android-SpinKit:1.4.0
- angular - 角度 > 材质表中的过滤器
- c# - 需要关于接口隔离原则的建议
- reactjs - 如何使用历史对象在注销时删除 redux 状态
- vba - 如何修复 vba 中的下标超出范围错误以在工作簿之间复制工作表
- jenkins - 用 groovy 替换 Curl 命令
- spring - 在corda中使用spring security的基本身份验证
- reactjs - 在本机反应中,文本隐藏在键盘下