Like this:

{attributes.map((items, index) => {
  return (
    <ul key={index}>
    {Object.keys(items).map((key) => {
      return (
        <li key={key + index}>{key}:{items[key]}</li>
      )
    })}
    </ul>
  )
})}
Answer from CD.. on Stack Overflow
🌐
Pluralsight
pluralsight.com › blog › tech guides & tutorials
Map JavaScript Object Keys Using React | Pluralsight
September 16, 2020 - Apart from the built-in method, it is easy to use an external library like Lodash to help you map over an object's keys. Lodash provides the _.keys method for mapping over an object's keys. There is a slight overhead in terms of performance that you will encounter by using this method, but it is also more succinct.
Discussions

REACT: Render the keys of only one object
So I have an object of objects, and I’m trying to render only the keys from the first object. I’ll post the full codepen at the end, but so far I’ve got: · Object.keys(this.props.data).filter((obj) => Object.keys(this.props.data).indexOf(obj) == 0) · Is being used to isolate the first ... More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
2
0
August 26, 2018
REACT: Render the keys of only one object
So I have an object of objects, and I’m trying to render only the keys from the first object. I’ll post the full codepen at the end, but so far I’ve got: · Object.keys(this.props.data).filter((obj) => Object.keys(this.props.data).indexOf(obj) == 0) · Is being used to isolate the first ... More on freecodecamp.org
🌐 freecodecamp.org
2
0
August 26, 2018
reactjs - How to display object's keys and values in react component - Stack Overflow
I have ControlSection component that one of it's props is statistics object prop. I want to display with all the key and values of the object. How can I do it? ControlSection: const More on stackoverflow.com
🌐 stackoverflow.com
reactjs - how to map an Object.keys array inside an Object.keys in react.js? - Stack Overflow
this error indicates that you have question(s) where answers property is undefined or null. This results in a call Object.keys(undefined) which throws the error. More on stackoverflow.com
🌐 stackoverflow.com
February 17, 2021
🌐
Reddit
reddit.com › r/reactjs › using object.keys() to turn a data object into an array, mapping the array, and passing the values as props.
r/reactjs on Reddit: Using Object.keys() to turn a data object into an array, mapping the array, and passing the values as props.
March 19, 2016 -

Right now I am making an app using the twitch api. There channels endpoint returns a data object. Since it's an object I can't map over it like normally I would if it was an array.

Thus why I am using Objects.keys(myObj) to turn the object into an array, however it's only an array of it's keys, and in order to get an array of the keys and values I have to do something like this

var myObj = {
  name: 'zack',
  age: 27,
  height: 511
};

var newArr = Object.keys(myObj);
console.log(newArr);

var mappedArr = newArr.map(function(i) {
  return [i, myObj[i]];
});

console.log(mappedArr);

the last console log is an array of my key:value pairs, but each key/value pair is in its own array.

I just want to take the object data, map through it, and pass certain parts of the objects data to a child component as props like this: https://gist.github.com/laere/eaf0fa4eb90b731f92e9

How can I achieve the same thing? Here is my code: https://gist.github.com/laere/ac142dedd253087ffda6

UPDATE I solved the issue. i realized I was being mentally retarded and not just calling the values within my component like this {myObj.name} or {myObj.whatevervalueithas}. I was overcomplicating it thinking I had to map over the data like my olther components. What a day.

🌐
freeCodeCamp
forum.freecodecamp.org › curriculum help
REACT: Render the keys of only one object - Curriculum Help - The freeCodeCamp Forum
August 26, 2018 - {Object.keys(obj)} Object.keys(this.props.data).indexOf(obj) == 0) Is being used to is...
🌐
UpStack
upstackhq.com › upstack blog › software development
Iterating On Objects In React
console.log(Object.keys(foobar)); // ['foo', 'bar', 'fizz'] console.log(Object.values(foobar)); // [3, 'seven', [1, 'b', false]] Generally speaking, when we’re working with React we are taking data and using that to render something to the screen for the user. In this situation, it’s typical to transform what we need from the object into an array. Arrays can almost immediately be transformed into JSX with a simple map, provided the data we map over has an accessible key, so they’re a much friendlier data type when trying to display data for the user.
Published: Aug 14, 2018
Author: serdartkm
Find elsewhere
🌐
Stack Overflow
stackoverflow.com › questions › 70892245 › react-object-keys-and-values
reactjs - React Object keys and values - Stack Overflow
January 28, 2022 - I have an object conf in React: Object.keys(conf): 0: "ubicacion1" 1: "ubicacion2" Object.values(conf): 0: "http://www.example1.es:8080" 1: "https://www.example2...
🌐
Medium
medium.com › @ismailtaufiq19 › display-objects-key-value-pairs-in-reactjs-95d8a26bd74b
Display Object’s Key-Value Pairs in ReactJS - Taufiq Ismail - Medium
August 25, 2023 - const Country = () =>{ const countryLang = { languages: { fra: "French", gsw: "Swiss German", ita: "Italian", roh: "Romansh" } } return( <div> <h2>Languages:</h2> <ul> {Object.keys(countryLang.languages).map((key, index)=>( <li key={index}>{countryLang.languages[key]}</li> ))} </ul> </div> ) } References: [1] https://www.pluralsight.com/guides/how-to-display-key-and-value-pairs-from-json-in-reactjs
🌐
npm
npmjs.com › package › react-key-from-object
react-key-from-object - npm
May 26, 2023 - Generate react keys from objects / functions ... anything · When using lists in React you need to use keys on items to let React know which array item is associated with which visual.
      » npm install react-key-from-object
    
Published: Jul 22, 2025
Version: 1.2.1
Author: Johan Maupetit
🌐
React
legacy.reactjs.org › docs › lists-and-keys.html
Lists and Keys – React
Keys serve as a hint to React but they don’t get passed to your components. If you need the same value in your component, pass it explicitly as a prop with a different name: const content = posts.map((post) => <Post key={post.id} id={post.id} title={post.title} /> ); With the example above, the Post component can read props.id, but not props.key. In the examples above we declared a separate listItems variable and included it in JSX:
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Object › keys
Object.keys() - JavaScript - MDN Web Docs
Object.keys() returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon object. This is the same as iterating with a for...in loop, except that a for...in loop enumerates properties in the prototype chain as well.
🌐
Bobby Hadz
bobbyhadz.com › blog › react-loop-through-object
How to Loop (or map()) through an Object in React | bobbyhadz
Copied!export default function App() { const employee = { id: 1, name: 'Bob', salary: 123, }; const results = []; Object.keys(employee).forEach(key => { results.push( <h2 key={key}> {key}: {employee[key]} </h2>, ); }); return ( <div> {results} </div> ); } ... The Array.forEach() method gets called with each key, however the forEach() method returns undefined, so we can't directly use it in our JSX code. Instead, we push JSX elements into an array that we render. Note that this is a more indirect approach and you won't see it used very often in React applications.
🌐
freeCodeCamp
forum.freecodecamp.org › t › problem-with-object-keys-map-in-react › 399310
Problem with Object.keys.map in React
June 5, 2020 - Hello ! I have a problem when I try to render something in React with Object.keys(Object).map. I have an object, games_list, which looks like this : games_list: { game1 : { name: "something", id: "something" }, game2 : { etc } } In my page, I’m trying to have cards with informations for each games on it (I’m using React Hooks in functional components) : return ( Your Games ...
🌐
GeeksforGeeks
geeksforgeeks.org › reactjs › how-to-set-an-object-key-inside-a-state-object-in-react-hooks
How to set an object key inside a state object in React Hooks? - GeeksforGeeks
January 14, 2021 - Solution: We can use the below syntax to set an object key inside a state object: data.address[0].city = 'jaipur'; setData({...data}); Creating React Application: Step 1: Create a React application using the following command: npx create-react-app foldername · Step 2: After creating your project folder i.e. foldername, move to it using the following command: cd foldername · Filename: App.js ·