- The first optimization we should look at is what is tracked in the state object of a given component. We should make sure that all the objects we have in the state are being used, and that each can potentially change, causing a desired re-render.
- Take a look at the render function of each component. The overall goal is to keep this function performing as fast as possible, so try to ensure that no long-running processes occur within it. If you can, cache computations and constant values outside the render function so that they are not instantiated every time.
- If you have conditional JSX that may return in the render function, return as early as possible. Here's a trivial example:
// unoptimized render() { let output; ...