Replies: 1 comment 3 replies
-
Good question! Here's what React says about breaking state up versus keeping it together:
so it seems reasonable to consolidate the state like you suggest. I assumed the state change would batch-update before rerendering, but React currently only batch-updates inside React event handlers (more info in this post), and our updates are happening inside a Firebase callback. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello I'm trying to add some features in your great lib and I struggle a bit because I'm new to react and quite new to modern JS ;-), so bear with my stupid questions.
I have a question about useFirebaseUser state.
At the moment it's define like that :
Each state-object update trigger a re-rendering of the React components using whenAuthUser*.
So my naïve question is : wouldn't it be better to use a single object to hold the state ?
Like :
Regards
Beta Was this translation helpful? Give feedback.
All reactions