Warning: Each child in a list should have a unique “key” prop.
next.js
Code that gives an error
const aaa = todos.map((todo:any, index:any) => {
return (
<>
<li key={todo.id}>
{todo.description}
</li>
</>
)
})
Error-free code
const aaa = todos.map((todo:any, index:any) => {
return (
<li key={todo.id}>
{todo.description}
</li>
)
})
If you remove <> … </>, the error will disappear.
Operating environment
$ sw_vers
ProductName: macOS
ProductVersion: 11.6.5
BuildVersion: 20G527
$ node -v
v16.13.0
$ npm list -g
├── @aws-amplify/cli@9.1.0
├── npm@8.1.0
関連記事

> Build optimization failed: found page without a React Component as default export in pages/xxxxxxx のエラー
動作環境 nextjs 解決方法 pages/xxxxx.tsx のファイルの中 ...

const [ session ] = useSession()でエラーになるのを解決
タイトルが適当ではない気がしますが・・・。検索で引っかかればOK的な感じです。 ...

【Amplify】The declaration was marked as deprecated here.の警告の回避方法
動作環境 amplify & next.js (2022年7月) npm ...

{“code”:”BadRequest”,”message”:”The server did not understand the operation that was requested.”,”type”:”client”}のエラー
動作環境 next.jsnode v16.13.0amplify NextAut ...

Next.jsのエラーの解消
Build optimization failed: found pages w ...