Reactjs: Key undefined when accessed as a prop

前端 未结 3 836
抹茶落季
抹茶落季 2020-12-31 06:19

Tools: Reactjs 0.14.0 Vanilla Flux

I need unique identifiers for 2 reasons:

  1. Child Reconciliation
  2. Keeping track of what child
3条回答
  •  借酒劲吻你
    2020-12-31 06:52

    key and ref aren't really 'props'. They're used internally by react and not passed to components as props. Consider passing it as a prop such as 'id'.

提交回复
热议问题