React hooks in react library giving Invalid hook call error

后端 未结 6 1584
灰色年华
灰色年华 2021-02-12 13:17

I create a react library using https://www.npmjs.com/package/create-react-library And successfully used it on other React project. But when I tried to use react hooks functiona

6条回答
  •  天命终不由人
    2021-02-12 13:28

    It worked for me when I changed the link from the app to the library to be "link:../" instead of "file:../", in addition to linking react and react-dom.

提交回复
热议问题