React question detail
2. **Two Phases of Rendering**
A. Render Phase (work-in-progress)
- React builds a work-in-progress Fiber tree.
- It walks through each component (begin phase), calculates what needs to change, and collects side effects (complete phase).
- This phase is interruptible—React can pause it and resume later.
B. Commit Phase
- React applies changes to the Real DOM.
- Runs lifecycle methods (e.g.,
componentDidMount,useEffect). - This phase is non-interruptible but fast.