how do i fix this annoying react error. see images below:
99% of the time when I get that error it’s because I screwed up an export or import. We can’t see your whole app, but confirm that App is exported as the default export. Confirm that other files are export and imported the same (usually default for components). You can even console.log them where they are imported to confirm that they are defined. Dollars to donuts, you’ll find that one of them is undefined
.
Oh wait, it says that it is an object. Never mind. In that case, it usually means that you are trying to render in JSX an object. Either because you are explicitly putting a variable there or because sometime is returning something incorrectly or some component is exported/imported incorrectly. Remember that you can put arrays of components in JSX, but not objects, and not arrays of objects.
i double checked now and everything is imported/exported fine. and i made mty files structure exactly like my previous project but i never had that error
Then the problem is likely in your JSX - somewhere you are trying to render and object.
aah thanks sooo much, i just missed something small again
Yep, I make that same mistake about once a day - and I do this for a living. We will always make mistakes - we just get better and finding them and fixing them.