Skip to content
- Summarising Thinking in React,
- 1. Break up the UI into a component hierarchy;
- 2. Build a static version in React;
- static representation requires lots of typing and not much thinking;
- interactivity requires lots of thinking and not much typing.
- 3. Find minimal but complete representation of UI state;
- Find all data pieces;
- Define what’s props and what’s state (props are passed top-down, state changes).
- 4. Identify where the state should live (at what height of the hierarchy);
- 5. Add inverse data flow.
- pass functions on children with onChange props so that the events on the children can affect the state of the parent.