#TypeError: Cannot read properties of null (reading 'usestate') at useProviderColorScheme

11 messages · Page 1 of 1 (latest)

limpid crater
#

I can't find a solution on how to fix this warning, I already double and triple checked our React versions, mantine versions and how I implement hooks in the application. I found an old thread in the support archive saying it could have been the create-react app fault, which I'm not using in this project

I'm using Mantine 7.7.0 and Next 13.4.19

limpid crater
#

the useState that trows an error is being used inside useProviderColorScheme, and yes it has use client

zealous marsh
limpid crater
zealous marsh
limpid crater
#

So in the situation where I have mutiple package.json (a ui library and a main application for example), I need to make sure to import react in only one otherwise it will show this warning. So if I go in a monorepo approach I will always encounter this

zealous marsh
limpid crater
#

Ok, so theoretically speaking if I centralized how I define the react dependency across the bundle and make sure that each packages/application uses that shared react dependency, the warning should disappear

limpid crater
#

I moved every "react": "18.2.0", "react-dom": "18.2.0" from the single packages to the root package and still the error is there, now I should only have just this version of react, but it doesn't seem to fix the issue

halcyon shell