React · Middle · Question 72 of 75

When does a useRef value change cause a re-render?

Explanation

Refs are for values that don't affect the output: timer ids, previous values, DOM nodes. If the UI should change, use state.

Further reading

Problem with a question

React · Middle · question 72

Test yourself

Take the React · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz