ReactId is a function that generates unique identifiers which can be used when mapping through list of .items in React.Js.
How to Install:
Run npm install reactjs-id in your CLI
How do I use ReactId in my project?
- Simply import {ReactId} from "reactjs-id";
- Next, invoke ReactId() in the component you need it. This could be your list component,
for instance: let mappedDessert = desserts.map(desert => <li key={ReactId()}>{desert.name} - {desert.calories} cal</li>)