From: Carl Worth <cworth@cworth.org> Date: Mon, 29 Jun 2020 15:05:23 +0000 (-0700) Subject: Add key to list of PromptOption components X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=d7cc3b52d47ed3836cea1d82951ea4db6e8c591d;p=lmno.games Add key to list of PromptOption components This is the classic thing to overlook in React programming. It's easy to forget the key until React warns that it's missing. --- diff --git a/empathy/empathy.jsx b/empathy/empathy.jsx index 4151cf7..feff777 100644 --- a/empathy/empathy.jsx +++ b/empathy/empathy.jsx @@ -414,7 +414,13 @@ const PromptOptions = React.memo(props => { Select any categories below that you'd like to play. You can choose as many as you'd like. </p> - {props.prompts.map(p => <PromptOption prompt={p} player={props.player} />)} + {props.prompts.map( + prompt => <PromptOption + key={prompt.id} + prompt={prompt} + player={props.player} + /> + )} </div> ); });