mirror of
https://github.com/LukeHagar/form.git
synced 2025-12-09 12:27:44 +00:00
feat(vue): field is now destructured from Field. TypeScript types are much more strict now
* fix(vue): Subscribe component default scoped slot types * fix(vue): Field component default scoped slot value types * example type fixes * remove test log * docs(vue): Field component slot fix * refactor(vue): remove unused children property type from field component * chore: fix formatting --------- Co-authored-by: Corbin Crutchley <git@crutchcorn.dev>
This commit is contained in:
@@ -29,7 +29,7 @@ describe('useForm', () => {
|
||||
|
||||
return () => (
|
||||
<form.Field name="firstName" defaultValue="">
|
||||
{(field: FieldApi<string, Person>) => (
|
||||
{({ field }: { field: FieldApi<string, Person> }) => (
|
||||
<input
|
||||
data-testid={'fieldinput'}
|
||||
value={field.state.value}
|
||||
@@ -69,7 +69,9 @@ describe('useForm', () => {
|
||||
|
||||
return () => (
|
||||
<form.Field name="firstName" defaultValue="">
|
||||
{(field: FieldApi<string, Person>) => <p>{field.state.value}</p>}
|
||||
{({ field }: { field: FieldApi<string, Person> }) => (
|
||||
<p>{field.state.value}</p>
|
||||
)}
|
||||
</form.Field>
|
||||
)
|
||||
})
|
||||
@@ -96,7 +98,11 @@ describe('useForm', () => {
|
||||
return () => (
|
||||
<form.Provider>
|
||||
<form.Field name="firstName">
|
||||
{(field: FieldApi<string, { firstName: string }>) => {
|
||||
{({
|
||||
field,
|
||||
}: {
|
||||
field: FieldApi<string, { firstName: string }>
|
||||
}) => {
|
||||
return (
|
||||
<input
|
||||
value={field.state.value}
|
||||
|
||||
Reference in New Issue
Block a user