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: |

NEWS: Telegram supports Facetime video calls NOW!

Secure video calling is in high demand. As an alternative to Zoom, many people are using end-to-end encrypted apps such as WhatsApp, FaceTime or Signal to speak to friends and family face-to-face since coronavirus lockdowns started to take place across the world. There’s another option—secure communications app Telegram just added video calling to its feature set, available on both iOS and Android. The new feature is also super secure—like Signal and WhatsApp and unlike Zoom (yet), video calls will be end-to-end encrypted.

That growth environment will include rising inflation and interest rates. Those upward shifts naturally accompany healthy growth periods as the demand for resources, products and services rise. Importantly, the Federal Reserve has laid out the rationale for not interfering with that natural growth transition.It's not exactly a fad, but there is a widespread willingness to pay up for a growth story. Classic fundamental analysis takes a back seat. Even negative earnings are ignored. In fact, positive earnings seem to be a limiting measure, producing the question, "Is that all you've got?" The preference is a vision of untold riches when the exciting story plays out as expected.

React from sa


Telegram React
FROM USA