React lets you build user interfaces out of individual pieces called components. Create your own React components like Thumbnail, LikeButton, and Video. Then combine them into entire screens, pages, and apps.
How to reproduce it
export default function WarningDemo() {
const fun = () => 0;
return (
<>
{fun}
</>
);
}
Warning
Warning: 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.
at WarningDemo
at div
at App
Solution
You have to call the function.
export default function WarningDemo() {
const fun = () => 0;
return (
<>
{fun()}
</>
);
}