-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Reference: facebook/react#14259
Any state updates triggered inside that callback will be batched. Any state updates triggered outside that callback will not be batched. Timeouts, promises, and async functions will end up executing outside that callback, and therefore not be batched.
Update states multiple times like
setA('a');
setB('b');within async function like api callback, timer etc...
will not batch updated
We can use useReducer to avoid redundant rendering calls.
ivan-kleshnin