how map work in react
{this.state.data.map((person) => <TableRow key = {shortid.generate()} data = {person} />)}
how map work in react
{this.state.data.map((person) => <TableRow key = {shortid.generate()} data = {person} />)}
new Map() collection in react state
function MapComponent(){
const [myMap, setMyMap] = useState(new Map());
const updateMap = (k,v) => {
setMyMap(new Map(myMap.set(k,v)));
}
return(
<ul>
{[...myMap.keys()].map(k => (
<li key={k}>myMap.get(k)</li>
))}
</ul>
);
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us