#error Each child in a list should have a unique key

9 messages · Page 1 of 1 (latest)

scenic shadow
#

@runic spire Do some of the game's have the same id?

#

I notice you're using game.id in one place and game.game_id in another - are you sure that's the right prop?

runic spire
#

@scenic shadow i made adjustments and the error is gone, the table is not displaying on the website tho here is the new code

#

(

            <h1> Games </h1>
            <table>
                <tbody>
                {games.map(game =>
                    <tr key={game.gameStatusId}>
                        <td key ={game.gameStatusId}> {(game.gameStatusId)} </td>
                        <td>
                            <button
                            >JOIN
                            </button>
                        </td>
                    </tr>)}
                </tbody>
            </table>
        </>
    );
}
#

None of the games have the same id, its a uique uuid

scenic shadow
#

"gameStatusId" is also a uuid?

runic spire
#

yes

#

thats the one i mean, i miswrote earlier

scenic shadow
#

Not sure then. If it's actually unique, you shouldn't be getting the error about duplicate keys.