Skip to content
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

Crash with react-native-debugger #34

Closed
fernandofranca opened this issue Apr 7, 2018 · 2 comments
Closed

Crash with react-native-debugger #34

fernandofranca opened this issue Apr 7, 2018 · 2 comments

Comments

@fernandofranca
Copy link

react-native-debugger packs Redux Devtools and when a component wrapped with withStatechart unmounts, an error will be thrown due window.__REDUX_DEVTOOLS_EXTENSION__.disconnect being unavailable.

Checking if the function is available should fix it: https://github.com/fernandofranca/react-automata/commit/b04b969bb89f2b76fa3038ab26740d932a2607d4?diff=split

@MicheleBertoli
Copy link
Owner

Thank you very much @fernandofranca for opening this issue.
I'm not familiar with react-native-debugger, but the disconnect method should exist in __REDUX_DEVTOOLS_EXTENSION__ (as described in the docs).
I recommend you open an issue in that package's repo and help make the API fully compatible.
I hope this makes sense for you.

@fernandofranca
Copy link
Author

Just in case, if anyone needs a simple solution:

if (window.__REDUX_DEVTOOLS_EXTENSION__ && 
  !window.__REDUX_DEVTOOLS_EXTENSION__.disconnect){
  window.__REDUX_DEVTOOLS_EXTENSION__.disconnect = () => {}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants