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:
Robert Soriano
2023-09-08 14:41:54 -07:00
committed by GitHub
parent 790c1aa226
commit 6935b330fa
6 changed files with 62 additions and 38 deletions

View File

@@ -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}