react-lifecycle-hooks icon indicating copy to clipboard operation
react-lifecycle-hooks copied to clipboard

不支持React Hooks component

Open TomJerryLGTM opened this issue 4 years ago • 2 comments

我的项目版本是React 16.7,所有Hooks component和函数式组件无法获取到,请问如何解决呢

TomJerryLGTM avatar Mar 25 '21 09:03 TomJerryLGTM

Thanks for the issue.

It might not be related to version of react but the tool transforming jsx.

Take <div /> for example. Previously, it was transformed to React.createElement('div') but now it will be something like jsxRuntime.jsx('div').

I remember it was mentioned in the previous change log of react (or CRA?) that the way jsx being transformed will change. But I do not have a plan on updating this project to catch up with the latest change yet. So I'd suggest you to downgrade your build tools (babel react, I suspect) (but I do not recommend this way) or look up for other tools.

Good luck :)

EnixCoda avatar Mar 25 '21 16:03 EnixCoda

不好意思,习惯性地回复了英文。如果还有问题我们可以中文聊。

EnixCoda avatar Mar 25 '21 16:03 EnixCoda