[英]Functions are not valid as a React child. This may happen if you return a Component instead of from render. Redux
I am working with react-redux, and I use stateless components我正在使用 react-redux,并且我使用无状态组件
This is my index.js这是我的 index.js
the store is in another index.js file, inside a folder called redux该商店位于另一个 index.js 文件中,位于名为 redux 的文件夹中
I have tried NewHOC, but I can't get rid of the error我已经尝试过NewHOC,但我无法摆脱错误
I believe you've had a look at this question since you mentioned "NewHOC".自从您提到“NewHOC”以来,我相信您已经看过这个问题。
With that in mind, ensure that in all your components you make use of a return
statement if they are functional components or have a render method if they are class based components.考虑到这一点,请确保在所有组件中,如果它们是功能组件,则使用
return
语句;如果它们是基于 class 的组件,则确保它们具有渲染方法。
Based on your screenshots, it seems RouterDirectory
is the likely culprit as the screenshots you did upload look fine but we can't see RouterDirectory.根据您的屏幕截图,
RouterDirectory
似乎是罪魁祸首,因为您上传的屏幕截图看起来不错,但我们看不到 RouterDirectory。
If you can provide the code for RouterDirectory
we can help you further.如果您可以提供
RouterDirectory
的代码,我们可以进一步帮助您。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.