create-guten-block
create-guten-block copied to clipboard
Using external component breaks Gutenberg
Hi everyone ! I love this plugin and I think it can be quite powerful but I'm encountering an issue that is blocking me. I want to use Material-UI react library to help me create blocks. When I import it and use it in the save method of a block, I have this 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 3. You might have more than one copy of React in the same app See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.
Yet, when I use it on an edit function, everything works smoothly. Just wondering how I could do that ?
Thanks everyone !
I think this might be the answer you are looking for: https://github.com/WordPress/gutenberg/issues/16843#issuecomment-517301811
So the only way to use external components would be to make the block be dynamic?