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
// when someone using useControlledState calls setControlledState(myFunc)
47
+
// this will call our useState setState with a function as well which invokes myFunc and calls onChange with the value from myFunc
48
+
// if we're in an uncontrolled state, then we also return the value of myFunc which to setState looks as though it was just called with myFunc from the beginning
49
+
// otherwise we just return the controlled value, which won't cause a rerender because React knows to bail out when the value is the same
0 commit comments