Skip to content

Move useForm inside SideModalForm - #1259

Merged
david-crespo merged 2 commits into
react-hook-formfrom
rhf-render-prop
Oct 26, 2022
Merged

david-crespo merged 2 commits into
react-hook-formfrom
rhf-render-prop

Conversation

@david-crespo

Copy link
Copy Markdown
Collaborator

No description provided.

@vercel

vercel Bot commented Oct 26, 2022

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
console-ui-storybook ✅ Ready (Inspect) Visit Preview Oct 26, 2022 at 6:43PM (UTC)

@david-crespo
david-crespo merged commit 6824d35 into react-hook-form Oct 26, 2022
@david-crespo
david-crespo deleted the rhf-render-prop branch October 26, 2022 18:43
david-crespo added a commit that referenced this pull request Oct 26, 2022
* can almost render?

* renders but doesn't validate and the types are still borked

* it kind of validates and the errors show up

* reset form on modal close, buncha TODO comments

* fix one type error, add another todo

* shut up the last type error

* validate on all change events so typing immediately enables submit

* move RHF things into their own folder

* add description field

* we don't actually need our own Form file

* don't need that class

* cleanup

* simplify side modal form props types

* dialogProps is now empty

* remove another props spread

* convert org edit too (easy peasy)

* don't pass ref to TextInput

* don't hard code the names of the fields

* "what the hell?" no more

* label is required

* ${label} is required

Co-authored-by: Justin Bennett <[email protected]>

* forward ref to TextInput, whatever

* pass way less to SideModalForm

* fix extra submit button on org edit

* don't spread props

* inline Form logic in SideModalForm

* get rid of SideModal id prop, fix SideModalForm title

* make e2e tests pass the easy way

* Update app/components/hook-form/fields/TextField.tsx

Co-authored-by: Justin Bennett <[email protected]>

* no cast!

* Move `useForm` inside `SideModalForm` (#1259)

* move useForm call inside SideModalForm, use render prop to pass control

* let SideModalForm take all the useForm props, not just defaultValues

* pull field error directly from fieldState

Co-authored-by: Justin Bennett <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — 5794477e Deployed Oct 26, 2022 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant