What is useTransition in React and why would you use it?

useTransition is a React Hook used to manage state updates that are less urgent and can be deferred. It helps in marking updates as non-urgent, allowing React to prioritize other high-priority updates, like user input.

It is commonly used for deferring expensive operations (e.g., data fetching or rendering large lists) to keep the UI responsive, especially during user interactions.

Without useTransition, expensive updates might block the browser's main thread, causing UI lags and an unresponsive interface.