const obj = { a: 'aa', b: 'bb' };
return {
<div>
{Object.entries(costss).map(([key, cost]) => {
return (
<button
key={cost}
type='button'
className='btn'
onClick={() => setInput(cost)}
>
{key}: {cost}
</button>
);
})}
</div>
}
Last active
July 16, 2021 02:07
-
-
Save jyydev/d707f343f9e2e7901ce55fa76552f609 to your computer and use it in GitHub Desktop.
React > jsx > object > .map()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment