Finally a tutorial I can use in a production app.
Just one concern.
// We only want to render the underlying app after we // assert for the presence of a current user.
return ( {!loadingInitial && children} );
How do you handle the app if the for some reason fetching the initial user data fails. That means the app will have a blank screen.
On "real apps" I would handle the error and show a "No internet" error screen, if the error is a network error generated by the user itself.
If a generic error comes from the server instead, we could show a 500 error page for example.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Finally a tutorial I can use in a production app.
Just one concern.
// We only want to render the underlying app after we
// assert for the presence of a current user.
return (
{!loadingInitial && children}
);
How do you handle the app if the for some reason fetching the initial user data fails. That means the app will have a blank screen.
On "real apps" I would handle the error and show a "No internet" error screen, if the error is a network error generated by the user itself.
If a generic error comes from the server instead, we could show a 500 error page for example.