I want to render a Object .
My Object is:
const ObjectTest = {
1: {
id : 1,
name:\'ABC\'
In react you can render your wish answer in browser screen by below code
import React from 'react';
const ObjectTest = {
1: {
id : 1,
name:'ABC'
},
3: {
id: 3,
name:'DEF'
}
}
class App extends React.Component {
constructor(props) {
super(props);
};
render() {
return (
{
Object.keys(ObjectTest).map((value,index)=>{
id is {ObjectTest[value].id} ; name is {ObjectTest[value].name}
});
}
);
}
}
export default App;