DEV Community

Cover image for Render a List from an Object in React
Aaron
Aaron

Posted on

Render a List from an Object in React

image from undraw.co

Sometimes the data we want to render in a list will be in an object rather than an array, to render it as a list we can take advantage of Object.keys so that we can map over the item like we would on a standard array.⠀

Note you could also look at using es6 Object.values or Object.entries here as well.

Check out the video below.

Head over to the reactjs.org docs for some more great examples.

Top comments (0)