You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a result of this change, even if MyApp needs to re-render, the components calling useContext(AuthContext) won’t need to re-render unless currentUser has changed.
This is not entirely true. because if MyApp re-renders, all of its children (including those consuming the context) will re-render by default, regardless if currentUser has changed or not.
The text was updated successfully, but these errors were encountered:
Summary
There is a paragraph about re-rendering of children when parent re-renders which doesn't seem to be accurate, see below.
Page
https://react.dev/reference/react/useContext#optimizing-re-renders-when-passing-objects-and-functions
Details
Here: https://react.dev/reference/react/useContext#optimizing-re-renders-when-passing-objects-and-functions,
it says in the bottom of the section:
This is not entirely true. because if
MyApp
re-renders, all of its children (including those consuming the context) will re-render by default, regardless ifcurrentUser
has changed or not.The text was updated successfully, but these errors were encountered: