React performance performance tip

Kent C. Dodds posted this article about “colocating” your state with your components:

He makes a compelling case for keeping the state of a component as close to the component that uses that state as possible.

There’s a (contrived) example in there where he shows how a poorly performing component can slow down the whole React tree and how moving all the components state down into their respective components fixes that.