Reputation: 3061
I am new to react native and I am trying to implement Redux in my application. React native throwing error while using connect function from react-redux as follows.
export default connect()(MyComponent);
I checked all 3 options and I am not breaking any:
Version of dependancies listed below:
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-native": "0.57.7",
"react-native-elements": "^0.19.1",
"react-native-geocoding": "^0.3.0",
"react-native-gesture-handler": "^1.0.12",
"react-native-maps": "https://github.com/react-community/react-native-maps.git",
"react-native-modal": "^9.0.0",
"react-native-router-flux": "^4.0.6",
"react-native-size-matters": "^0.1.4",
"react-native-super-grid": "^3.0.4",
"react-native-vector-icons": "^4.6.0",
"react-navigation": "^3.0.9",
"react-redux": "^7.0.3",
"redux": "^4.0.1",
"redux-logger": "^3.0.6"
Error disappear when I remove connect(). But it prevents from implanting Redux
Is this a bug in React Native or I am doing something wrong here?
Upvotes: 1
Views: 678
Reputation: 1256
Try to update react-native to 0.59.x.
Looks like react-redux switched to use React hooks internally. But react-native added React hooks support starting from version 0.59 (https://facebook.github.io/react-native/blog/2019/03/12/releasing-react-native-059).
Upvotes: 1