expo / dev-plugins

Out-of-tree Expo devtools plugins for packages that haven't adopted the Expo devtools plugin system yet.
MIT License
146 stars 24 forks source link

App crashes as soon as plugin hook runs #40

Closed bpeltonc closed 4 months ago

bpeltonc commented 4 months ago

I created a new plugin following the documentation, imported the hook inside my root component, and immediately got the following error when trying to start my app.

` ERROR TypeError: Cannot read property 'useState' of null

This error is located at: in App (at withDevTools.ios.js:29) in withDevTools(Anonymous) (at renderApplication.js:57) in RCTView (at View.js:116) in View (at AppContainer.js:127) in RCTView (at View.js:116) in View (at AppContainer.js:155) in AppContainer (at renderApplication.js:50) in main(RootComponent) (at renderApplication.js:67), js engine: hermes ERROR TypeError: Cannot read property 'useState' of null

This error is located at: in App (at withDevTools.ios.js:29) in withDevTools(Anonymous) (at renderApplication.js:57) in RCTView (at View.js:116) in View (at AppContainer.js:127) in RCTView (at View.js:116) in View (at AppContainer.js:155) in AppContainer (at renderApplication.js:50) in main(RootComponent) (at renderApplication.js:67), js engine: hermes`

The error resolves if i comment out the call to useDevToolsPluginClient('my-plugin')