Server data not updating properly
Answered
Silver carp posted this in #help-forum
Silver carpOP
Hey! I'm fetching data from my backend, and passing it to a server component to display. I'm sending 9 elements to my frontend, however for some reason it displays 10. The extra one seems to be from the page prior to that page. Any clue why?
https://i.imgur.com/OPwh1VI.gif
https://i.imgur.com/OPwh1VI.gif
Answered by Ray
I saw you pass the name as key, could it be there are two item with same name?
11 Replies
Silver carpOP
As seen here, I'm sending the data to the component as
contentI'm just displaying the content in
<ContentDisplay>When I log the length of the data being sent, its 9
But displays 10?
@Silver carp I'm just displaying the content in `<ContentDisplay>`
I saw you pass the name as key, could it be there are two item with same name?
Answer
@Ray I saw you pass the name as key, could it be there are two item with same name?
Silver carpOP
Yeah, that fixed it
Really weird
Never knew that, changed the key to the index
Appreciate it
@Silver carp Really weird
The key have to be unique for identification with react
Silver carpOP
ah