Update react-dom peerDependencies to match react (17/18/19)#37
Update react-dom peerDependencies to match react (17/18/19)#37erikras-dinesh-agent wants to merge 1 commit intomasterfrom
Conversation
📝 WalkthroughWalkthroughUpdated the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@package.json`:
- Line 95: The package declares compatibility with React 19 but the component
Html5ValidationField.tsx uses ReactDOM.findDOMNode(this), which was removed in
React 19; update the code to remove findDOMNode usage by adding and using a
React ref on the DOM element (createRef/useRef) inside the Html5ValidationField
component and replace all ReactDOM.findDOMNode(this) calls with accesses to that
ref (e.g., this.inputRef.current or inputRef.current), or alternatively restrict
the peer dependency to exclude React 19 by changing the react-dom range; prefer
the ref-based refactor for forward/functional components and ensure event
handlers and validation logic reference the new ref variable (and update any
lifecycle methods or hooks that relied on findDOMNode).
| "final-form": ">=5.0.0", | ||
| "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", | ||
| "react-dom": "^18.2.0", | ||
| "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for React DOM 18+ APIs and React 18+ features
echo "=== Searching for react-dom/client imports ==="
rg -n 'react-dom/client' --glob '!**/node_modules/**' -C 2 || echo "No matches found"
echo -e "\n=== Searching for createRoot/hydrateRoot APIs ==="
rg -n 'createRoot|hydrateRoot' --glob '!**/node_modules/**' -C 2 || echo "No matches found"
echo -e "\n=== Searching for React 18+ hooks (useTransition, useId, etc.) ==="
rg -n 'useTransition|useId|useSyncExternalStore' --glob '!**/node_modules/**' -C 2 || echo "No matches found"
echo -e "\n=== Searching for ReactDOM.render (deprecated in 18) ==="
rg -n 'ReactDOM\.render\s*\(' --glob '!**/node_modules/**' -C 2 || echo "No matches found"
echo -e "\n=== File listing to understand project structure ==="
find . -name 'src' -o -name 'lib' -o -name 'index.ts' -o -name 'index.js' | head -20Repository: final-form/react-final-form-html5-validation
Length of output: 454
🏁 Script executed:
#!/bin/bash
# Check what's in the source code and what React/React DOM APIs are being used
echo "=== Listing all source files ==="
fd -e ts -e tsx -e js -e jsx . src/
echo -e "\n=== Reading main index file ==="
cat -n src/index.ts
echo -e "\n=== Checking for any React imports ==="
rg -n 'from ["\']react' src/ || echo "No React imports found"
echo -e "\n=== Checking for any react-dom imports ==="
rg -n 'from ["\']react-dom' src/ || echo "No react-dom imports found"Repository: final-form/react-final-form-html5-validation
Length of output: 557
🏁 Script executed:
#!/bin/bash
# Check React imports and component implementation
echo "=== Checking for React imports ==="
rg -n "from ['\"]react" src/ || echo "No React imports found"
echo -e "\n=== Reading main component file ==="
cat -n src/Html5ValidationField.tsx | head -100
echo -e "\n=== Checking package.json dependencies ==="
cat package.json | jq '{dependencies, devDependencies, peerDependencies}'Repository: final-form/react-final-form-html5-validation
Length of output: 6758
Address React 19 incompatibility: ReactDOM.findDOMNode() is unavailable in React 19.
The code uses ReactDOM.findDOMNode(this) (line 45 of Html5ValidationField.tsx), which was removed in React 19. Either narrow the peer dependency to exclude React 19, or refactor the component to use React refs instead of findDOMNode.
🤖 Prompt for AI Agents
In `@package.json` at line 95, The package declares compatibility with React 19
but the component Html5ValidationField.tsx uses ReactDOM.findDOMNode(this),
which was removed in React 19; update the code to remove findDOMNode usage by
adding and using a React ref on the DOM element (createRef/useRef) inside the
Html5ValidationField component and replace all ReactDOM.findDOMNode(this) calls
with accesses to that ref (e.g., this.inputRef.current or inputRef.current), or
alternatively restrict the peer dependency to exclude React 19 by changing the
react-dom range; prefer the ref-based refactor for forward/functional components
and ensure event handlers and validation logic reference the new ref variable
(and update any lifecycle methods or hooks that relied on findDOMNode).
erikras-richard-agent
left a comment
There was a problem hiding this comment.
LGTM ✅
Simple, correct change. The react-dom peerDependencies should match the react peerDependencies to ensure version compatibility.
Changes:
- Updated from
^18.2.0to^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - Now matches the
reactpeer dependency pattern
Testing:
- ✅ All CI checks passing
- ✅ No code changes, only package.json metadata
Ready to merge.
Summary
Update
react-dompeerDependencies to matchreactversions (17, 18, 19).Problem
reactpeerDeps:^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0react-dompeerDeps:^18.2.0(missing 17 and 19!)This closes TWO long-standing PRs:
Solution
Updated
react-domto matchreactpeerDeps exactly.Thank you to the contributors of #28 and #30 for your patience! 🙏
Summary by CodeRabbit