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
If you need the current value of state while processing setState you should use the overload setState(previousState => ({/* ... */})) since the actual change of the state is not immediate.
The text was updated successfully, but these errors were encountered:
@ChristianIvicevic ah good catch. I suppose the current impl doesn't explode because these handlers are only called in response to user events, which happen rarely (not more than once per frame), but your proposal is the best practice.
While reading through the new sample code for the PanelStack component I noticed multiple calls to
setState
which seem to be wrong:blueprint/packages/docs-app/src/examples/core-examples/panelStackExample.tsx
Line 49 in f29ca79
blueprint/packages/docs-app/src/examples/core-examples/panelStackExample.tsx
Line 55 in f29ca79
If you need the current value of
state
while processingsetState
you should use the overloadsetState(previousState => ({/* ... */}))
since the actual change of the state is not immediate.The text was updated successfully, but these errors were encountered: