You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to use our own implemented react error boundaries that would act the same for dev and prod (well... prod-like testing environments). It doesn't seem to be possible to disable Error Boundaries in when AppContainer.dev.js is used.
Passing in a config object as the 2nd argument to hot() that looks like this: {errorBoundary: false} has no impact.
The above false errorBoundary config prop + using setConfig({ ErrorOverlay: () => null }) results in catching the error in dev and displaying only the react-hot-loader Error emojis: https://i.imgur.com/iHPYZJA.png
Expected behavior
Setting errorBoundary to false should turn off all error boundary functionality. (I realize that since we don't have multi-level inheritance, that it might require creating another AppContainer.dev.js without the componentDidCatch --- or, wait... does that void return cause other catches in the chain to be able to catch? Maybe another condition simply needs to be added to if (!hotComparisonOpen()).
Actual behavior
Error Boundary always catches and always displays something, regardless of config.
Environment
React Hot Loader version: 4.6.5
Run these commands in the project folder and fill in their results:
const hmrOptions = {
errorBoundary: false,
};
setConfig({ ErrorOverlay: () => null });
export default hot(module, hmrOptions)(App, hmrOptions); // looking through the source, one of these isn't necessary, but now I don't remember which. 😄
The text was updated successfully, but these errors were encountered:
I was quite sure that after that last changes (ie hotComparisonOpen) ErrorBoundaries are working only when for HMR, not when an application is a normal state. Let me play with your example.
@theKashey - when I happened upon that bug, commented, and saw your quick response last week, I was sure it would fix the issue I was having. So, ME TOO! :-)
Description
I'd like to use our own implemented react error boundaries that would act the same for dev and prod (well... prod-like testing environments). It doesn't seem to be possible to disable Error Boundaries in when AppContainer.dev.js is used.
Passing in a config object as the 2nd argument to
hot()
that looks like this:{errorBoundary: false}
has no impact.The above false errorBoundary config prop + using
setConfig({ ErrorOverlay: () => null })
results in catching the error in dev and displaying only the react-hot-loader Error emojis:https://i.imgur.com/iHPYZJA.png
Expected behavior
Setting errorBoundary to false should turn off all error boundary functionality. (I realize that since we don't have multi-level inheritance, that it might require creating another AppContainer.dev.js without the componentDidCatch --- or, wait... does that void
return
cause other catches in the chain to be able to catch? Maybe another condition simply needs to be added toif (!hotComparisonOpen())
.Actual behavior
Error Boundary always catches and always displays something, regardless of config.
Environment
React Hot Loader version: 4.6.5
Run these commands in the project folder and fill in their results:
yarn -v
: 1.12.1 (using yarn)npm -v
: 6.4.1node -v
: 11.0OS: High Sierra 10.13.6
Browser: Chrome 71.0.3578.98 (Official Build) (64-bit)
Reproducible Demo
You can use this boilerplate and simply put
x=y
in the render method.https://github.com/MichalZalecki/react-boilerplate-lite
Using different combinations of:
The text was updated successfully, but these errors were encountered: