Skip to content
Advertisement

Functions are not valid as a React child. This may happen if you return a Component instead of from render. in react v6

Hello I’m new to react and got myself stuck here, my version is v6 and hence having a bit of a problem understanding, I’m following a tutorial from udemy

The error that occurred is – Functions are not valid as a React child. This may happen if you return a Component instead of from render. Or maybe you meant to call this function rather than return it.

this is in my Home.js

JavaScript

my App.js looks like this

JavaScript

Advertisement

Answer

In your react router use the render method.

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement