github nhost/nhost @nhost/react@0.4.0

latest releases: release-20240501, @nhost/dashboard@1.14.0, @nhost/dashboard@1.13.3...
2 years ago

Minor Changes

  • 39df4d5: Deprecate useAuthLoading and introduce useAuthenticationStatus
    When using both useAuthLoading and useAuthenticated together, the hooks rerender independently from each other.
    As a result, when a user loads the page while he previously authenticated, the hooks values were chronologically:

    isLoading isAuthenticated
    true false
    false false
    false true

    The intermediate (false, false) is incorrect and is causing issues when using an authentication gate.

    It is therefore recommended to stop using useAuthLoading, and to use useAuthenticationStatus instead, in order to keep the loading state and the authentication in sync within the same hook.

    Usage:

    const { isLoading, isAuthenticated } = useAuthenticationStatus()

    Fixes this issue

Don't miss a new nhost release

NewReleases is sending notifications on new releases.