“Each child in an array should have a unique key prop” only on first time render of page

前端 未结 1 1234
生来不讨喜
生来不讨喜 2021-01-14 00:58

I have a with a bunch of inside that consists of all users logged in through Instagram. The is provid

1条回答
  •  一整个雨季
    2021-01-14 01:09

    You need to add the key property where you are rendering , not where you are defining it:

    component1 = React.createClass({
        render: () ->
            # A lot of table stuff here
            _.chain(@state.users).map((x) -> ),@).value()
    )}
    
    component2 = React.createClass({
        render: () ->
            return (
                
                    Blah
                    Blah
                    Blah
                
            )
    })
    

    0 讨论(0)
提交回复
热议问题