react-datepicker@7.6.0 and later (including v8 and v9) depend on @floating-ui/react@^0.27, which explicitly dropped React 16 support in its 0.27.0 release:
breaking: drop React 16 support. 17 is the minimum supported version.
However, react-datepicker continues to declare react@"^16.9.0 || ^17 || ^18 || ^19" in its peerDependencies, claiming React 16 compatibility.
This causes peer dependency warnings on npm install for any project using React 16:
npm warn Could not resolve dependency:
npm warn peer react@">=17.0.0" from @floating-ui/react@0.27.20
npm warn node_modules/react-datepicker/node_modules/@floating-ui/react
The mismatch was introduced in #5268 (dependabot bump of @floating-ui/react from 0.26.27 to 0.27.0, merged Dec 6 2024).
Expected: Either:
- Pin
@floating-ui/react to ^0.26 to actually support React 16 as declared (this would be great), or
- Update
peerDependencies to react@">=17" to honestly reflect the minimum supported version
Versions affected: 7.6.0+ (including 8.x and 9.x)
react-datepicker@7.6.0and later (including v8 and v9) depend on@floating-ui/react@^0.27, which explicitly dropped React 16 support in its 0.27.0 release:However,
react-datepickercontinues to declarereact@"^16.9.0 || ^17 || ^18 || ^19"in itspeerDependencies, claiming React 16 compatibility.This causes peer dependency warnings on
npm installfor any project using React 16:npm warn Could not resolve dependency:
npm warn peer react@">=17.0.0" from @floating-ui/react@0.27.20
npm warn node_modules/react-datepicker/node_modules/@floating-ui/react
The mismatch was introduced in #5268 (dependabot bump of
@floating-ui/reactfrom 0.26.27 to 0.27.0, merged Dec 6 2024).Expected: Either:
@floating-ui/reactto^0.26to actually support React 16 as declared (this would be great), orpeerDependenciestoreact@">=17"to honestly reflect the minimum supported versionVersions affected: 7.6.0+ (including 8.x and 9.x)