functions are not valid as a react child
//instead of passing in a function as a child
❌ //this is not the correct way of doing it
const MyElement = () =>(
<>
<h2>This is a sample element</h2>
</>
)
...return( <MyElement/>)
✅ //do this instead
const MyElement = (
<>
<h2>This is the correct way</h2>
</>
)
...return( <MyElement/>)