Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check if devtools hook on/off methods are defined before using them i…
…n AppContainer (#39808) Summary: Pull Request resolved: #39808 I've been doing some tests where I disable React DevTools locally and this code has been crashing because React Fast Refresh defines the React DevTools hook if DevTools didn't ([pointer](https://github.com/facebook/react/blob/85c2b519b54269811002d26f4f711809ef68f123/packages/react-refresh/src/ReactFreshRuntime.js#L453-L475)), and it doesn't actually define the `on` and `off` methods, which makes this throw. This changes `AppContainer` to check if the methods are defined before using them. Changelog: [internal] Reviewed By: hoxyq Differential Revision: D49909258 fbshipit-source-id: 3b0c1f37601a1cbe38f80ca3a20ffe2348a21aaf
- Loading branch information