How to render a Object in React?

后端 未结 4 859
忘了有多久
忘了有多久 2021-02-14 09:16

I want to render a Object .

My Object is:

const ObjectTest = {
        1: {
            id : 1,
            name:\'ABC\'
                 


        
4条回答
  •  醉酒成梦
    2021-02-14 09:42

    I wonder why it seems that almost every one is using Object.keys!

    Object.values(ObjectTest).map((row_, index) =>
        
        {Object.values(row_).map(item => {item})}
        
    )}

    Sample Data:

    const ObjectTest = {
            1: {
                id : 1,
                name:'ABC'
            },
            3: {
                id: 3,
                name:'DEF'
            }
    }

提交回复
热议问题