Hello, I'm trying to use theme-ui along with creative Tim's material kit.
It uses a lot of HOC's which I think may be the issue... would that make sense?
I am getting the following error when I add gatsby-plugin-theme-ui or even try to wrap a themeprovider around any element. I tried wrapping a page then to narrow it down wrapping a simple
Thanks in advance for any help :)
ร
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.
woops reinstall node modules fixed
For others ending up here.
The result of npm ls react was:
โโโ [email protected]
โโโฌ [email protected]
โโโ [email protected]
deleting node_modules and reinstalling won't work by itself
must also resolve in package-lock.json
(was a new project for me so I just deleted package-lock.json
before npm installing again)
The result of npm ls react is now:
โโโ [email protected]
โโโฌ [email protected]
โโโ [email protected] deduped
where the second react is deduped, which resolves this
https://reactjs.org/warnings/invalid-hook-call-warning.html#duplicate-react
running into this right now but i dont see theme-ui mentioned at all.
โโโฌ @storybook/[email protected]
โ โโโฌ @storybook/[email protected]
โ โ โโโ [email protected] deduped
โ โโโฌ @storybook/[email protected]
โ โ โโโ [email protected] deduped
โ โโโ [email protected] deduped
โโโฌ @storybook/[email protected]
โ โโโฌ @storybook/[email protected]
โ โโโฌ @storybook/[email protected]
โ โโโ [email protected] deduped
โโโฌ [email protected]
โ โโโฌ [email protected]
โ โโโ [email protected] deduped
โโโ [email protected]
could this have something to do with the peerDependency or themeui /* jsx */ renderer?
https://github.com/system-ui/theme-ui/blob/master/packages/core/package.json#L23
seems like a glitch in the matrix. removing node_modules and reinstalling them fixed it together with gatspy cleanup ๐คทโโ๏ธ.
Most helpful comment
For others ending up here.
The result of
npm ls reactwas:deleting node_modules and reinstalling won't work by itself
must also resolve in
package-lock.json(was a new project for me so I just deleted
package-lock.jsonbefore npm installing again)
The result of
npm ls reactis now:where the second react is deduped, which resolves this
https://reactjs.org/warnings/invalid-hook-call-warning.html#duplicate-react