我想从一个react组件中检索组件的id,以便为第3部分库执行一些有意义的操作。我怎么才能拿到呢?
例如,在Ember中,您可以通过elementId,https://www.emberjs.com/api/ember/2.14/classes/Ember.Component/properties/elementId?anchor=elementId访问它。
发布于 2017-07-21 15:48:16
为
<div id="specialId" />我想你能做到:
this.refs.specialId
https://stackoverflow.com/questions/45241187
复制相似问题