React ref returns a 'Connect' object instead of DOM

后端 未结 2 489
攒了一身酷
攒了一身酷 2020-12-31 11:38

I\'m trying to create dynamics refs for custom components created through the map function.

2条回答
  •  星月不相逢
    2020-12-31 12:21

    An alternative way to do this would be to use some other prop name (other than ref). For example:

     { this.myRef = node; }}
    />
    

    This also works if you're using a library like styled-components or emotion

提交回复
热议问题