fix: add unique key prop to conversation starter list items (#619)
- Changed key from question text to combination of index and question text - Ensures unique keys even if translation has duplicate questions - Resolves React warning: 'Each child in a list should have a unique key prop'
This commit is contained in:
parent
120fcfb316
commit
025ea6b94e
|
|
@ -26,7 +26,7 @@ export function ConversationStarter({
|
||||||
<ul className="flex flex-wrap">
|
<ul className="flex flex-wrap">
|
||||||
{questions.map((question, index) => (
|
{questions.map((question, index) => (
|
||||||
<motion.li
|
<motion.li
|
||||||
key={question}
|
key={`${index}-${question}`}
|
||||||
className="flex w-1/2 shrink-0 p-2 active:scale-105"
|
className="flex w-1/2 shrink-0 p-2 active:scale-105"
|
||||||
style={{ transition: "all 0.2s ease-out" }}
|
style={{ transition: "all 0.2s ease-out" }}
|
||||||
initial={{ opacity: 0, y: 24 }}
|
initial={{ opacity: 0, y: 24 }}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue