故事书CRA打字稿中发生钩子调用

时间:2020-10-29 08:02:10

标签: reactjs typescript storybook

我遵循了CRA故事书设置。

npx create-react-add my-app --template typescript
npx -p @storybook/cli sb init
yarn storybook

但是遇到这个错误。

Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks............blah blah

and 

The above error occurred in the <ManagerConsumer> component:
    in ManagerConsumer
    in Unknown (created by Layout)
    in div..........

出什么问题了?

0 个答案:

没有答案