RHF+ is a fork of react-hook-form (RHF) with feature enhancements. It is designed to be a drop-in replacement for RHF so you can use it in your existing projects without any changes.
npm install @bombillazo/rhf-plus
- Imperative Form Submission
- Form metadata
- Controllable
isLoading
state - Add displayName to
useFormContext
- Improve
useController
error on missingcontrol
prop - More to come... (Become a contributor)
RHF is a robust and delightful form library for React. Preserving high-quality standards for such a popular package takes time, effort, and thoughtfulness from maintainers. In the case of RHF, this has caused a development bottleneck that slows and stalls contributions.
Thus, rhf-plus
was born: a fork of RHF that enhances the library with new features and improvements while keeping the core of RHF intact.
- Features: This package aims to enhance RHF's functionality. We avoid other development efforts.
-
Compatibility: New features should be additive, not destructive.
rhf-plus
aims to stay closely synced to the original RHF. - Practicality: The enhancements must be practical and solve real-world problems.
- Speed: Discuss, review, and ship features fast!
- Quality: We maintain the same high-quality standards as RHF. This means clean code, testing, and clear documentation.
-
RHF bugs
RHF maintainers are responsible for fixing RHF bugs. We focus on fixing bugs related to our enhancements. When RHF bugs are fixed, those fixes are rolled into this package when we sync to the latest RHF version. -
Refactors
We do not refactor RHF code. This includes adding new tooling, changing documentation, updating dependency versions, fixing code styling, and anything unrelated to adding new features and enhancements (these changes complicate syncing the fork with RHF). -
Breaking changes
We do not introduce breaking changes to the RHF API. We only add new features and enhancements that are backward compatible with the existing RHF API. -
Complex/bloated features
We avoid enhancements that aggressively modify large parts of the RHF codebase. This ensures we do not diverge too much from the original RHF package. -
Past RHF versions
As new enhancements are introduced, they are only applied to the current and latest RHF versions. This ensures that we are closely synced to RHF and reduces the overhead of maintaining multiplerhf-plus
versions.
Ideally, this fork would not exist, and all of these enhancements and features would be natively part of RHF. You can help RHF and RHF+ grow by:
- Spreading the word about this fork so more people test these enhancements
- Using this library to test the enhancements and provide feedback.
- Reporting enhancement bugs and issues here.
- Contributing new code to add new enhancements.
- Sharing the enhancements in the react-hook-form issues (create a new one if it doesn't exist).:
- Upvote the issue to garner support
- Kindly comment on the issue to show RHF maintainers there is a demand
- Link to the enhancement page in this repo to show the working solution is available
[!Note] Please contact the maintainers if a new RHF version is available and this library is behind. We will sync
rhf-plus
and release a new version.
rhf-plus
versions look something like this:
7.55.0-plus.0
\____/\____/|
| | |
1 2 3
-
RHF version
The react-hook-form version used as the base to add enhancements to (e.g.,7.55.0
) -
Separator token
Separates RHF from RHF+ version (always-plus.
) -
RHF+ version
RHF+ version index (e.g.,0
)
- New RHF+ versions use the latest RHF version as the base version
- RHF+ versions start from index
0
- For example, the first version of
rhf-plus
based on RHF7.55.0
would be7.55.0-plus.0
- For example, the first version of
- The RHF+ version increments with each new
rhf-plus
release- For example, a new release based on RHF
7.55.0
would bump the version to7.5.0-plus.1
- For example, a new release based on RHF
- The RHF+ version is reset to
0
when a new version of RHF is released- For example, if RHF
7.56.0
is released, the newly synced version ofrhf-plus
based on that would be7.56.0-plus.0
- For example, if RHF