【发布时间】:2020-05-28 08:56:24
【问题描述】:
我想知道您可以在嵌套应用程序中将 forwardRef 向下传递多深,以及如何将它向下传递?
类似这样的:
<Parent>
<Child>
....
</Child>
</Parent>
<Child>
<GrandChild>
....
</GrandChild>
</Child>
<GrandChild>
<GreatGrandChild>
....
</GreatGrandChild>
</GrandChild>
<GreatGrandChild>
....
</GreatGrandChild>
然后在 GreatGrandChild 组件中使用它或将 Parent 中的 ref 和元素向下传递给 GreatGrandChild
【问题讨论】:
标签: reactjs ref react-forwardref