mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-19 04:14:46 +08:00
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:
committed by
Willem Jiang
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 }}
|
||||||
|
|||||||
Reference in New Issue
Block a user