From 12bb439348e3c5fd1b363aa7065bcb3ae190ccc8 Mon Sep 17 00:00:00 2001 From: Erik Rasmussen Date: Fri, 6 Feb 2026 16:46:49 +0100 Subject: [PATCH 1/2] fix: align react-dom peerDependency with react version range Closes #28 Closes #30 The react peerDependency supports React 16.8+, 17, 18, and 19, but react-dom was locked to ^18.2.0, causing peer dependency warnings for users on React 17 and earlier. This aligns react-dom to match the react version range, allowing the library to work correctly across all supported React versions. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7538a1e..a7bd3e5 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "peerDependencies": { "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", "react-final-form": ">=7.0.0" }, "jest": { From b8056d97a1c26054cb894ed0162360154778b4d9 Mon Sep 17 00:00:00 2001 From: Erik Rasmussen Date: Fri, 6 Feb 2026 18:49:31 +0100 Subject: [PATCH 2/2] docs: add React compatibility section to README Addresses CodeRabbit feedback to document supported React versions. The library supports React 16.8+, 17.x, 18.x, and 19.x as declared in the peerDependencies. CI currently tests against React 18.x only. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index dcabd3c..b16711e 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,18 @@ yarn add react-final-form-html5-validation react-final-form final-form [![Edit 🏁 React Final Form - HTML5 Validation Example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/14r018yjp4) +## React Compatibility + +This library supports React 16.8+ (with Hooks), React 17, React 18, and React 19. + +**Supported versions:** +- React 16.8.0 or higher +- React 17.x +- React 18.x +- React 19.x + +**Note:** CI currently tests against React 18.x. While the library is compatible with React 16.8+, 17.x, and 19.x based on the peer dependency declaration, full automated test coverage across all versions is not yet implemented. + ## Usage The way you specify rules and error messages in HTML5 is by giving first a rule prop, e.g. `required`, `min`, `maxLength`, and then an error message prop, e.g. `valueMissing`, `rangeUnderflow`, or `tooLong`, respectively. This library comes with built-in English defaults for the error messages, but you will probably want to override those by passing in your own.