Conditinal rendering, listrendering , list with map event hadling with hooks Summary Table 📘 React: Rendering Lists with .map() markdown Copy Edit
Step | What to Do | Example Code |
---|---|---|
1 | Make an array | const arr = ["A", "B"]; |
2 | Make a component | function MyList() { ... } |
3 | Use .map() in JSX | {arr.map((x, i) => <li key={i}>{x}</li>)} |
4 | Use your component | <MyList /> |