简体   繁体   中英

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

The error

This is my index.js

My app.js

the store is in another index.js file, inside a folder called redux

I have tried NewHOC, but I can't get rid of the error

I believe you've had a look at this question since you mentioned "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.

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.

If you can provide the code for RouterDirectory we can help you further.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM