-
Notifications
You must be signed in to change notification settings - Fork 45.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Uncaught TypeError: Cannot read properties of null (reading 'useMemo') [React 18.3.1] #28947
Comments
This looks like you might be missing to update |
Yeah @owenn2106 did you update your |
I have a similar error, but with
I updated Stack trace:
|
@kassens @rickhanlonii Yeap, my react-dom is updated to |
Turns out we are having this issue because we have multiple copies of React. My team has a monorepo, which has a shared folder and these shared folder has a dependency of React 18. Package json looks like: "peerDependencies": {
"@types/react": "^17 || ^18",
"react": "^17 || ^18",
"react-dom": "^17 || ^18"
}, So we had to just change the peer dependencies to "peerDependencies": {
"@types/react": "^17 || ^18.3.0",
"react": "^17 || ^18.3.0",
"react-dom": "^17 || ^18.3.0"
}, |
Since the error message already contains this as the first recommendation, I don't think there's more we can do, unfortunately :( |
I have upgraded to React
18.3.1
, previously from18.2.0
. After upgrading, my app won't start. At first it's due touseMemo
in<PortalProvider />
which is a component fromblueprintjs
. When I open the file, it looks something like:From the error message, here I'm assuming
React
is null, but I'm not sure why. This was working fine before with18.2.0
. I tried removing this<PortalProvider />
component, but I get another error in<Provider />
fromreact-redux
, but this time instead ofuseMemo
, it errors out withuseContext
. All I did was upgrade the React version nothing else. Am I missing something? I would like to upgrade to18.3.1
to prepare for React 19.React version:
18.3.1
Blueprintjs version:
5.10.2
Redux version:
4.2.1
React-redux version
8.1.3
My
src/index.tsx
:The text was updated successfully, but these errors were encountered: