-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Local State for Immediate UI Updates with Deferred Global Store S…
…ync (#3193) closes #3178 This approach mimics the [useDeferredValue](https://react.dev/reference/react/useDeferredValue ) hook value method that is only available on react 19 - Introduces a local state to handle immediate UI updates for text based controlled inputs. - Ensures smoother user experience by eliminating lag caused by global store updates. - Global state updates are now deferred, preventing excessive store updates on key clicks in order to keep the UI update process free and responsive. - Syncs local state with external value changes to maintain consistency. **This approach ensures real-time user feedback with zero lag** An alternative but much larger scope approach would be to restructure the component tree and optimize the use of selectors to minimize re-renders caused the global store and prop drilling. However it could potentially not reach the zero lag achieved by the deferring approach as it guarantees UI update calls have the highest priority
- Loading branch information
Showing
1 changed file
with
40 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters