Remove useUser
's initialData
override
#539
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
useUser
currently overridesinitialData
ifauth.currentUser
is not undefined:reactfire/src/auth.tsx
Lines 29 to 33 in 414201e
The idea was that we might be able to get
useUser
to load with the correct auth state faster than if we had waited for the underlyinguseIdTokenResult
to finish. This was based on the assumption thatauth.currentUser
isundefined
while the Auth SDK is booting up,null
only when the Auth SDK is booted up and a user isn't signed in, and truthy otherwise.However, this is undocumented behavior, so we shouldn't rely on it.