CHEWCHEWW/react-web-editor

Invalid Hook Call Warning

MinhHoang2000 opened this issue · 6 comments

When I use react-web-editor, application had a error "Invalid hook call. Hooks can only be called inside of the body of a function component"

Oh! Can you tell me about the specific Situation that occurred this warning?
Thank you for letting me know.

Hi CHEWCHEWW,

The same errror "Invalid hook call. Hooks can only be called inside of the body of a function component.". Occurred with me as well.

My Steps were as simple as it can be :

  1. Installed the library with npm.
  2. Imported the TextEditorBlock in my component
  3. Boom ! the app was down and displayed errors

index.js:1 The above error occurred in the component:
in TextEditorBlock (at StoryBuilder.js:11)
in StoryBuilder (created by Context.Consumer)
in Route (at Admin.js:130)
in Switch (at Admin.js:180)
in div (at Admin.js:175)
in div (at Admin.js:164)

Please fix this, this is great library and might just not be popular because we cannot get past this error

This is because of mismatching versions in React. I updated the dependencies in this PR #20

hi could this PR be merged please? I'm trying to use this but unable to do so because of the hook warning :(