React is saying a function can not be passed as a child
Hello,
I am trying to render a list of components on one of my pages, however when doing so I am getting the following error:
Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.
Any idea why this could be? Thanks for the help!
7 Replies
If you want to inline a function like this it has to be an IIFE
you have to call it inline like that
Side note you can put switches in that lol
Inline state reducer 🤣🤣🤣
That makes total sense, don't know why I didn't think of that. Thanks!
sure thing!
Are you learning?
No, just my brain forgets stuff sometimes lmao
Glad this helped then!!