-
Notifications
You must be signed in to change notification settings - Fork 943
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
Add LoadableComponentErrorBoundary for handling ChunkLoadErrors #1416
Conversation
b08d280
to
56694e4
Compare
@@ -11,7 +11,7 @@ import css from './LayoutSingleColumn.module.css'; | |||
|
|||
const prepareChildren = children => { | |||
const childrenCount = React.Children.count(children); | |||
if (!(childrenCount === 3 || childrenCount === 4)) { | |||
if (!(childrenCount === 2 || childrenCount === 3)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this has been a copy paster error from LayoutSideNavigation? Before the LoadableComponentErrorBoundaryPage we didn't have any page that would use LayoutSingleColumn without footer so that's why this has maybe not been noticed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change also that ”Menu” on next line :)
const landingPagePath = pathByRouteName('LandingPage', routeConfiguration()); | ||
const handleOnClick = () => { | ||
if (typeof window !== 'undefined') { | ||
window.location = landingPagePath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want the app to make full page refresh when navigating back LandingPage. I'm not sure if there is some other (better) way to trigger that or if this is ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine.
src/components/LoadableComponentErrorBoundary/LoadableComponentErrorBoundaryPage.js
Outdated
Show resolved
Hide resolved
src/components/LoadableComponentErrorBoundary/LoadableComponentErrorBoundary.module.css
Outdated
Show resolved
Hide resolved
56694e4
to
5792594
Compare
b1469fe
to
5792594
Compare
5792594
to
3a2fd45
Compare
Adds ErrorBoundary for showing the error page if there's a ChunkLoadError