fix: narrow react/react-dom peerDependencies to drop false React 16 claim - #6323
Draft
SaiBalaji202 wants to merge 1 commit into
Draft
fix: narrow react/react-dom peerDependencies to drop false React 16 claim#6323SaiBalaji202 wants to merge 1 commit into
SaiBalaji202 wants to merge 1 commit into
Conversation
…laim Fixes Hacker0x01#6321 package.json peerDependencies still claimed React 16 support ("^16.9.0 || ^17 || ^18 || ^19"), but our positioning dependency, @floating-ui/react, dropped React 16 as of its 0.27.0 release (peerDependencies: react: ">=17.0.0", verified in the installed node_modules/@floating-ui/react/package.json). The mismatch was introduced in Hacker0x01#5268, a dependabot bump of @floating-ui/react that updated the dependency without updating our own peerDependencies floor. Every React 16 install has been getting an npm peer-dependency warning since that bump, for a version range we don't actually support. Why floating-ui dropped it: floating-ui/floating-ui#3103 (closing floating-ui/floating-ui#3092, WONTFIX) — React 16 attaches synthetic event listeners to `document`, React 17+ attaches them to the root container instead. floating-ui's useDismiss + FloatingPortal outside-click logic depends on the React 17+ attachment point, so nested portals need two clicks to dismiss on React 16 instead of one. Does this repo hit that bug? No: src/with_floating.tsx only imports useFloating/autoUpdate/flip/offset/arrow (positioning) and never useDismiss or FloatingPortal — outside-click is handled by our own ClickOutsideWrapper instead. So the one known React-16 bug upstream can't fire through this codebase's usage. This fix is metadata-only; no runtime code changes, since the code path that could have broken was never used. Also updated the React compatibility table in README.md, which repeated the same "React 16 or newer" claim for current versions. Note for reviewers: narrowing a peerDependencies *range* is itself semver-breaking for anyone still on React 16, even though application code is untouched here — npm/pnpm peer resolution can go from a soft warning to a hard install failure for those installs. Worth calling out in release notes rather than shipping as an invisible patch. Verified: yarn type-check, yarn eslint, and yarn test (1485/1485, 43/43 suites) all pass unchanged on this branch. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TcacPbehewGNsFHmrLeA6j
SaiBalaji202
marked this pull request as draft
August 24, 2026 06:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Linked issue: #6321
Problem
package.jsonpeerDependenciesstill claim React 16 support(
^16.9.0 || ^17 || ^18 || ^19), but our positioning dependency,@floating-ui/react,dropped React 16 support as of its
0.27.0release — the installed@floating-ui/reactalready declarespeerDependencies: { react: ">=17.0.0" }. EveryReact 16 install of
react-datepickerhas been getting annpm warnpeer-dependencyerror since
@floating-ui/reactwas bumped past0.27.0in #5268, for a React versionwe don't actually support end-to-end.
Why floating-ui dropped React 16
Traced to floating-ui/floating-ui#3103
(purely a
peerDependencies/changeset bump — no source changed), which closesfloating-ui/floating-ui#3092
(WONTFIX): on React 16, nested
FloatingPortals need two clicks to dismiss instead ofone. React 16 attaches synthetic event listeners to
document; React 17+ attaches themto the root container instead, and floating-ui's
useDismiss+FloatingPortaloutside-click logic relies on the React 17+ attachment point.
Does this bug reach react-datepicker?
No.
src/with_floating.tsxonly importsuseFloating/autoUpdate/flip/offset/arrowfrom@floating-ui/react— pure positioning. It never importsuseDismissorFloatingPortal; outside-click handling here is our ownClickOutsideWrapper. So theone documented React-16 regression upstream can't fire through this codebase's usage.
Fix
Metadata-only — no runtime code changes, since the code path that could have broken was
never used:
package.json— narrowreact/react-dompeerDependenciesto^17 || ^18 || ^19 || ^19.0.0-rc, matching@floating-ui/react's own floor.yarn.lock— regenerated so the workspace metadata matches.README.md— the "Compatibility" table repeated the same stale "React 16 or newer" claim for current versions; added a line clarifying versions after v9.1.0 require React 17+.Note for reviewers
Narrowing a
peerDependenciesrange is itself semver-breaking for anyone still onReact 16, even though application code is untouched — npm/pnpm peer resolution can go
from a soft warning to a hard install failure for those installs. Worth calling that out
explicitly in release notes rather than shipping it as an invisible patch (i.e. this
probably wants to land as at least a semver-minor with a changelog note, if not paired
with a major bump).
Contribution checklist
yarn type-check,yarn eslint, andyarn test(1485/1485 tests, 43/43 suites) all pass unchanged.