-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Realm React
-
Labels:
-
2 - S (<= 1 week)
-
4973
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.