React · Senior · Question 59 of 75

A text input at the top of a large page makes the whole page re-render on each keystroke. What is the simplest fix?

Explanation

State changes re-render the component that owns it and its children. Keeping fast-changing state close to where it's used limits the work without any memoization.

Further reading

Problem with a question

React · Senior · question 59

Test yourself

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

Take this quiz