Using Hooks for performance optimizations
Certain Hooks can be used to optimize the performance of your app. Generally, the rule of thumb is to not optimize prematurely. This is especially true with the React Compiler, introduced in React 19. Nowadays, the React Compiler optimizes most cases for us automatically. So, keep in mind to only use these Hooks when you have identified a specific performance problem with your app. Generally, the rule of thumb is to not optimize prematurely unless you know it will be an expensive computation.
The React Compiler is a Babel plugin that can be manually installed, and it also ships with certain frameworks, such as Next.js. For more information on the React Compiler, please read the following page in the React docs: https://react.dev/learn/react-compiler.
useDeferredValue
The Deferred Value Hook can be used to defer low-priority updates (such as filtering a list) so that higher-priority updates (such as updating the text...