What's new in React 17?
Last updated: March 16, 2025 at 12:00 AM
No New Features, Just Improvements
React 17 focused on improving the existing architecture rather than introducing new features.
Improved Event Delegation
Events are now attached to the root rather than document
.
// Before React 17
// Event listeners were attached to document
ReactDOM.render(<App />, rootNode);
// In React 17
// Event listeners are attached to the root DOM container
ReactDOM.render(<App />, rootNode);
Gradual Upgrades
Better compatibility with older versions of React.
// React 17 app
const root = document.getElementById('root');
ReactDOM.render(<App />, root);
// React 18 app inside React 17 app
const newRoot = document.getElementById('new-root');
// Can use React 18 features here
ReactDOM.createRoot(newRoot).render(<NewApp />);
JSX Transform Update
Allows using JSX without explicitly importing React.
// Before React 17
import React from 'react';
function App() {
return <h1>Hello World</h1>;
}
// After React 17
// No need to import React when using JSX
function App() {
return <h1>Hello World</h1>;
}