Skip to content

setLoading needs to splitΒ #46

@zik200

Description

@zik200

setLoading(false);

setLoading(false);

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:

  1. possibility that the server is down, but redux initialized successfully, so no "loading.." will occur unless 'error' flag is also set quickly.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions