prescottprue / react-redux-firebase

Redux bindings for Firebase. Includes React Hooks and Higher Order Components.
https://react-redux-firebase.com
MIT License
2.55k stars 559 forks source link

Issue with preloading user profile on SSR #1022

Open carl0s-sa opened 3 years ago

carl0s-sa commented 3 years ago

Do you want to request a feature or report a bug?
Both

What is the current behavior? I preload the store with user profile data, SSR the page (works fine), then on client action @@reactReduxFirebase/LOGIN resets my profile data and later fills it with @@reactReduxFirebase/SET_PROFILE which causes a flicker when page loads.

What is the expected behavior? When updating state for @@reactReduxFirebase/LOGIN action perform a validation if the profile contains keys isEmpty and isLoaded set to false and true respectively, in which case it would not clean profile (Maybe add a special key for preloaded profile and remove that key if present?) Screenshot 2020-10-28 at 00 39 27

I may be doing this wrong, but documentation on SSRing is not very clear. It doesn't mention auth properties like currentUser and what not