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


React Telegram | DID YOU KNOW?

Date: |

A Telegram spokesman declined to comment on the bond issue or the amount of the debt the company has due. The spokesman said Telegram’s equipment and bandwidth costs are growing because it has consistently posted more than 40% year-to-year growth in users.

Telegram Gives Up On Crypto Blockchain Project

Durov said on his Telegram channel today that the two and a half year blockchain and crypto project has been put to sleep. Ironically, after leaving Russia because the government wanted his encryption keys to his social media firm, Durov’s cryptocurrency idea lost steam because of a U.S. court. “The technology we created allowed for an open, free, decentralized exchange of value and ideas. TON had the potential to revolutionize how people store and transfer funds and information,” he wrote on his channel. “Unfortunately, a U.S. court stopped TON from happening.”

React from de


Telegram React
FROM USA