null is not an object (evaluating 'dispatcher.useState') with RN 0.68.1
See original GitHub issueSteps to reproduce
- create a bare RN app with
npx react-native init DripsyTest - Install Dripsy
npm install dripsy --save npm startandnpm run ios- Replace
App.jscode with:
import React from 'react';
import {DripsyProvider, makeTheme, View} from 'dripsy';
const theme = makeTheme({});
export default function App({Component, pageProps}) {
return (
<DripsyProvider theme={theme}>
<View />
</DripsyProvider>
);
}
Expected result
App starting successfully
Actual result

ERROR Warning: 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://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
DripsyProvider@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.DripsyTest:116768:30
App@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.DripsyTest:111689:25
RCTView
View
RCTView
View
AppContainer@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.DripsyTest:78446:36
DripsyTest(RootComponent)@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.DripsyTest:85130:28
ERROR Warning: 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://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
DripsyProvider@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.DripsyTest:116768:30
App@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.DripsyTest:111689:25
RCTView
View
RCTView
View
AppContainer@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.DripsyTest:78446:36
DripsyTest(RootComponent)@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.DripsyTest:85130:28
ERROR TypeError: null is not an object (evaluating 'dispatcher.useState')
This error is located at:
in DripsyProvider (at App.js:7)
in App (at renderApplication.js:50)
in RCTView (at View.js:32)
in View (at AppContainer.js:92)
in RCTView (at View.js:32)
in View (at AppContainer.js:119)
in AppContainer (at renderApplication.js:43)
in DripsyTest(RootComponent) (at renderApplication.js:60)
ERROR TypeError: null is not an object (evaluating 'dispatcher.useState')
This error is located at:
in DripsyProvider (at App.js:7)
in App (at renderApplication.js:50)
in RCTView (at View.js:32)
in View (at AppContainer.js:92)
in RCTView (at View.js:32)
in View (at AppContainer.js:119)
in AppContainer (at renderApplication.js:43)
in DripsyTest(RootComponent) (at renderApplication.js:60)
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
TypeError dispatcher.useState is not a function when using ...
as I want to try out the new React hooks proposal by installing react@16.8.1 in my package.json , but I'm getting an error:...
Read more >null is not an object (evaluating e.endCoordinates) #31 - GitHub
Bug I use useKeyboard hook, and when the keyboard is closing I got an error null is not an object (evaluating e.endCoordinates).
Read more >TypeError: dispatcher.useState is not a function for React ...
Coding example for the question TypeError: dispatcher.useState is not a function for React Native-React Native.
Read more >Hooks API Reference - React
Unlike the setState method found in class components, useState does not automatically merge ... Accepts a context object (the value returned from React....
Read more >How to use React useReducer hook like a pro - Devtrium
We'll learn about how dispatch works later on. ... While the useState version is probably familiar to you (if not, it might be...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

i assume you’re using npm. try using legacy peer deps
This worked for me, thanks a lot!