Telegram Group & Telegram Channel
🔥 Оптимизируй React-компоненты с помощью useDeferredValue

Если у тебя есть input, фильтрация, поиск или ререндер списков — не спеши лепить useMemo и useCallback. Сначала попробуй useDeferredValue:


const deferredQuery = useDeferredValue(query);
const filtered = useMemo(() => filterData(data, deferredQuery), [deferredQuery]);


📌 Что делает?
useDeferredValue говорит React: "не срочно, можно чуть позже"
— идеально для плавности UI без блокировок при частых обновлениях.

🧠 Кейс:
Пользователь быстро вводит текст → React не тормозит от ререндеров больших списков → всё работает плавно и отзывчиво.

⚠️ Но не путай с debounce:
- debounce — задержка до начала работы
- useDeferredValue — отложенный рендер результата

📎 Официальная дока https://react.dev/reference/react/useDeferredValue

✍️ @React_lib



tg-me.com/React_lib/671
Create:
Last Update:

🔥 Оптимизируй React-компоненты с помощью useDeferredValue

Если у тебя есть input, фильтрация, поиск или ререндер списков — не спеши лепить useMemo и useCallback. Сначала попробуй useDeferredValue:


const deferredQuery = useDeferredValue(query);
const filtered = useMemo(() => filterData(data, deferredQuery), [deferredQuery]);


📌 Что делает?
useDeferredValue говорит React: "не срочно, можно чуть позже"
— идеально для плавности UI без блокировок при частых обновлениях.

🧠 Кейс:
Пользователь быстро вводит текст → React не тормозит от ререндеров больших списков → всё работает плавно и отзывчиво.

⚠️ Но не путай с debounce:
- debounce — задержка до начала работы
- useDeferredValue — отложенный рендер результата

📎 Официальная дока https://react.dev/reference/react/useDeferredValue

✍️ @React_lib

BY React




Share with your friend now:
tg-me.com/React_lib/671

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

The messaging service and social-media platform owes creditors roughly $700 million by the end of April, according to people briefed on the company’s plans and loan documents viewed by The Wall Street Journal. At the same time, Telegram Group Inc. must cover rising equipment and bandwidth expenses because of its rapid growth, despite going years without attempting to generate revenue.

How to Invest in Bitcoin?

Like a stock, you can buy and hold Bitcoin as an investment. You can even now do so in special retirement accounts called Bitcoin IRAs. No matter where you choose to hold your Bitcoin, people’s philosophies on how to invest it vary: Some buy and hold long term, some buy and aim to sell after a price rally, and others bet on its price decreasing. Bitcoin’s price over time has experienced big price swings, going as low as $5,165 and as high as $28,990 in 2020 alone. “I think in some places, people might be using Bitcoin to pay for things, but the truth is that it’s an asset that looks like it’s going to be increasing in value relatively quickly for some time,” Marquez says. “So why would you sell something that’s going to be worth so much more next year than it is today? The majority of people that hold it are long-term investors.”

telegram from br


Telegram React
FROM USA