key is not available as prop in the Child component in ReactJs

前端 未结 2 1922
南旧
南旧 2021-01-13 06:13

I have a parent component in which below component is producing dynamically in map function as below:

const renderListing = this.props.listi         


        
2条回答
  •  攒了一身酷
    2021-01-13 06:34

    Most props on a JSX element are passed on to the component, however, there are two special props (ref and key) which are used by React, and are thus not forwarded to the component.

    Special Props Warning – React

提交回复
热议问题