React Lifecycles Compatibility Polyfill

JSON →
library 3.0.4 ·javascript maintenance
verified May 27, 2026

`react-lifecycles-compat` is a JavaScript polyfill designed to provide backwards compatibility for React class components. It enables the use of the `static getDerivedStateFromProps` and `getSnapshotBeforeUpdate` lifecycles (introduced in React 16.3) with older versions of React, specifically 0.14.9+. This functionality was critical for libraries and applications during the transition period when React deprecated `componentWillMount`, `componentWillReceiveProps`, and `componentWillUpdate` due to issues with async rendering. By using this polyfill, developers could adopt the newer, safer lifecycles without forcing users of older React versions to upgrade their entire React setup, thus facilitating a smoother ecosystem transition. The package is currently at version 3.0.4. While still functional, its primary relevance has diminished significantly with the widespread adoption of modern React versions (17+) and the prevalence of React Hooks.

total hits 13
actors 5 distinct systems
last hit 23h ago human
GPTBot
5
Script
1
ClaudeBot
1
Search engines
1
Humans
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · 🇫🇷 France · SN