-
Notifications
You must be signed in to change notification settings - Fork 597
Open
Description
SocialEcho/client/src/AppContainer.jsx
Line 46 in 4dc6c78
| setLoading(false); |
SocialEcho/client/src/AppContainer.jsx
Line 28 in 4dc6c78
| setLoading(false); |
SocialEcho/client/src/AppContainer.jsx
Line 53 in 4dc6c78
| if (loading || error) { |
Currently setLoading is shared with the redux store initialization and the server-status check.
If any one of them passes, the app renders.
So you can have:
- possibility that the server is down, but redux initialized successfully, so no "loading.." will occur unless 'error' flag is also set quickly.
- Even worse, the server-status check completes really fast, before redux store is initialized, and the app tries to acces useState for example before the store is up. (Ask me how i know π)
Better to split the two, have two flags and check for both.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels