How to render a Object in React?

后端 未结 4 852
忘了有多久
忘了有多久 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:44

    const ObjectTest = {
            1: {
                id : 1,
                name:'ABC'
            },
            3: {
                id: 3,
                name:'DEF'
            }
    }
    render(){
       return (
             
    Object.keys(ObjectTest).map( (key)=> { return
    "Id is:"{key} "Name is:"{ObjectTest[key].name}
    })
    ) }

提交回复
热议问题