Skip to content
This repository was archived by the owner on Oct 14, 2026. It is now read-only.

fix: respect as prop before render for components and HTML tags - #114

Closed
rishilifts wants to merge 3 commits into
react-hook-form:masterfrom
rishilifts:fix-88-as-precedence
Closed

rishilifts wants to merge 3 commits into
react-hook-form:masterfrom
rishilifts:fix-88-as-precedence

Conversation

@rishilifts

Copy link
Copy Markdown

Fixes #88.

The README says as takes precedence over render. That works for an element, but a component or HTML tag currently gets skipped when render is also set.

Create the supplied component or tag before considering the render callback. The element path and render-only path stay unchanged.

Added two regression cases that check the wrapper and verify the callback is not called. Both fail before the fix. Updated the existing component-plus-render snapshot to include its expected div wrapper.

Validation with the repository's frozen yarn lockfile:

  • 24 tests and 22 snapshots pass.
  • Full lint, typecheck and build pass.
  • Statement, function and line coverage are 100%; branch coverage is 85.71%.

@bluebill1049

Copy link
Copy Markdown
Member

please use this component instead: https://react-hook-form.com/docs/useformstate/errormessage

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

as prop does not take precedence over components

2 participants