I've been learning to code for about 3 months now and I've gotten pretty far with an APP I created but when I inspect the page, I have over 50 warnings. Here are some of the warnings
react-dom.development.js:67 Warning: Text content did not match. Server: "Sign out" Client: "Create" at a at O (http://localhost:3000/_next/static/chunks/pages/_app.js?ts=1647879270456:148896:19599) at Link (http://localhost:3000/_next/static/chunks/pages/_app.js?ts=1647879270456:89219:19) THERE ARE BOUT 10 LINKS SIMILAR TO THE ONES ABOVE THAT FOLLOW
VM2101 react_devtools_backend.js:3973 Warning: Each child in a list should have a unique "key" prop.
Check the render method of
AllAssets
. See https://reactjs.org/link/warning-keys for more information. at O (http://localhost:3000/_next/static/chunks/pages/_app.js?ts=1647879270456:148896:19599) at AllAssets (http://localhost:3000/_next/static/chunks/pages/index.js?ts=1647879270456:40:73) THERE ARE BOUT 10 LINKS SIMILAR TO THE ONES ABOVE THAT FOLLOWVM2101 react_devtools_backend.js:3973 Warning: The tag is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter. at image at O (http://localhost:3000/_next/static/chunks/pages/_app.js?ts=1647879270456:148896:19599) at span at O (http://localhost:3000/_next/static/chunks/pages/_app.js?ts=1647879270456:148896:19599) THERE ARE BOUT 10 LINKS SIMILAR TO THE ONES ABOVE THAT FOLLOW
These equal out to about 100 lines of errors all seeming to be referring to the same issues. To be honest, I don't really know how to address tese. Like for example, the one that sasys that all child lists should have a key prop. I'm pretty sure it's referring to some instances where I have the following:
return (
<ul>
{assets.map((result) => {
const {
collection: { name },
data: { image },
} = result;
if (name !== null) {
return (
<Container>
<Card key={name}>
<CollectionAvatar
image={image}
/*name={name || collection}*/
type="collection"
/>
<br></br>
<br></br>
{name}
</Card>
</Container>
);
}
})}
</ul>
);
}
You see, I added a key, but I don't really know if that's the right way to do it or if I added the wrong key etc. I'm still learning about this.
Typing this up I realize that I have a few questions:
- Are the errors that I have shown critical? Do they need to be fixed before deploying?
- Is there anyway to hide these in the meantime if they are not critical so that I can fix them at a later time?
- How can I find out what the error is talking about. I see a link but I don't understand what the result is showing me.
Thanks for you patience. Like I said, I'm learning and I realize I still have a lot to learn but I'd appreciate some clarity on this!
` can simply be `
`, i.e. doesn't need an open and close. Also, elements in a `
` should be `- ` elements, but you're using `
`; that might cause problems.