Frontend Development ยท React
How should state and useState be used in a production React application?
Keep state minimal, colocate it near the components that own it, derive values during render when possible, and use functional updates when the next value depends on the previous state.