Simple Patterns:
- useState with init function
- setState with function
- Toggle reusable custom hook
- Computed values with useMemo
Advanced Patterns:
- Resource fetching
- Easier controlled components
- Throttling with useCallback and useRef
- Custom hook for objects using lodash
- useReducer with action creators
- useState complex object with actions
- Making setInterval declarative (Dan Abramov)
- Composing setters
Complex UI problems:
Pitfalls:
Under the hood:
Submit a PR to contribute more examples. Please follow the same format