Get component name in React

前端 未结 5 1925
暗喜
暗喜 2020-12-05 18:08

I\'m developing a React application. I have a Loading component, which is a little animation for waiting. I want to add a message in this Loading component according to the

5条回答
  •  失恋的感觉
    2020-12-05 18:35

    After searching with debugger, in newer versions you should use this._reactInternalFiber.elementType.name instead of this._reactInternalInstance.getName()

提交回复
热议问题