xiongemi
xiongemi

Reputation: 209

React Native TypeError: dispatcher.useSyncExternalStore is not a function

I am using React Native 0.68.1 with React 18 and I got this error after upgrading: enter image description here

It works fine with presentational component, but as soon as I change to a smart component with connected function from 'react-redux', it throws the above error.

my packages:

    "react": "18.0.0",
    "react-dom": "18.0.0",
    "react-native": "0.68.1",
    "react-native-paper": "^4.12.0",
    "react-native-safe-area-context": "^4.2.4",
    "react-native-screens": "^3.13.1",
    "react-native-vector-icons": "^9.1.0",
    "react-native-web": "^0.17.7",
    "react-redux": "8.0.1",
    "@reduxjs/toolkit": "1.8.1",

Upvotes: 2

Views: 3768

Answers (2)

Mahii
Mahii

Reputation: 92

change react-redux version ==> "react-redux": "^7.2.8",

Upvotes: 1

phry
phry

Reputation: 44086

The problem are your dependencies. React native is at this point only compatible with react 17, so you will need to downgrade react. Also, you probably should deinstall react-dom, since you are not working in the browser.

Upvotes: 4

Related Questions