useRef: How to Stop Re-Rendering in React
Автор: Alxandria - Science should be free
Загружено: 2025-12-20
Просмотров: 0
Описание:
useRef is a React Hook that lets you store a mutable value that does NOT cause a re-render when it changes.
Think of it as:
🧠 A box that React keeps for you between renders.
const myRef = useRef(initialValue);
myRef is an object
myRef.current holds the value
Updating myRef.current does not trigger a re-render
If the value affects what you see → useState
If it doesn’t → useRef
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: