Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-1927

The implementation of `useUser` should never return `undefined`

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Realm React
    • Labels:

      The useUser hook would return undefined if the user isn't logged in. This should actually never be undefined, since it isn't possible to render the application without a logged in user (at least when using sync).
      Since it is typed to sometimes be undefined, the underlying code must always check if it isn't, which isn't very clean. The UserProvider and useUser should be refactored to always return a user.

            Assignee:
            Unassigned Unassigned
            Reporter:
            andrew.meyer@mongodb.com Andrew Meyer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: