- Instant help with your JavaScript coding problems

Add key prop to React fragment

How to add key prop to React fragment?
<React.Fragment key={id}>

You can create React fragments with the short syntax: <>...</> However, with this syntax, you can not add key props. To add a key prop, simply use the normal syntax <React.Fragment key={myKey}>


Share "How to add key prop to React fragment?"