← React Beginner Questions - Set 8 Q79

What is the role of the useRef hook?

React Beginner Questions - Set 8

Example

const renders = useRef(0);
renders.current += 1;   // survives renders, never triggers one

What to notice

← Back to the question list