Inside React 16 (Fiber) – What’s Changing?
July 20, 2017
React 16 ships with Fiber, a total rewrite of the reconciliation engine aimed at smoother UIs and better error handling.
What is Fiber?
- Breaks rendering into small units of work called fibers.
- Allows React to pause, resume, and prioritise rendering, preventing long blocks.
- Enables future features like time‑slicing and concurrent rendering.
Practical wins in React 16
- Error boundaries – components can catch render errors and show fallback UI.
- Return arrays from render – no extra wrapper elements needed.
- Portals – render children into a different DOM subtree.
- Smaller bundle – core size dropped compared with React 15.
- Better SSR – streaming server‑side rendering support.
Minimal error boundary
class ErrorBoundary extends React.Component {
state = { hasError: false };
componentDidCatch(error, info) {
this.setState({ hasError: true });
// log error or send to monitoring
}
render() {
if (this.state.hasError) {
return <h1>Something went wrong.</h1>;
}
return this.props.children;
}
}
Wrap parts of your app:
<ErrorBoundary>
<ProfilePage />
</ErrorBoundary>
Returning multiple elements
function List() {
return [
<li key="a">A</li>,
<li key="b">B</li>
];
}
Later versions added the shorter <>…</>
fragment syntax.
When Fiber matters
- Complex updates like animations or rich editors benefit from interruptible rendering.
- Apps with heavy trees gain smoother scrolling and gestures.
- Error boundaries keep the rest of the UI running after a crash.
Upgrade notes
- Public API is mostly unchanged; update warnings from React 15 should be resolved first.
- Old lifecycle hooks (
componentWillMount
, etc.) may show deprecation warnings. - Third‑party libraries generally work; check those touching internals.
React 16’s Fiber engine lays the groundwork for future concurrent features while already improving stability and developer experience.
Recent posts
- At-Least-Once vs. Exactly-Once - Understanding Message Delivery Guarantees
June 12, 2025
Learn about message delivery guarantees in distributed systems. Understand why most production systems implement at-least-once delivery with idempotency rather than attempting exactly-once delivery.
- How Idempotency Saves Your API from Chaos
June 11, 2025
Learn how to implement idempotency in your APIs to prevent duplicate actions and ensure data consistency. Includes practical examples with Supabase and Node.js.
- Vibe Coding ‑ Notes from the First Try
June 6, 2025
Quick lessons from spinning up a new blog with an AI pair‑programmer and Cursor.