fix: Field components should now infer state.value properly

* chore: refactor TS typings for React

* fix: field should now infer state.value properly in React adapter

* chore: fix Vue package typings

* chore: fix linting

* chore: fix React adapter

* chore: improve performance of TData type in FieldApi

* chore: add back index and parent type

* chore: add Vue TSC dep on Vue example

* chore: fix lint and type test

* chore: update Vite stuff

* chore: add implicit dep for Vue and React examples

* chore: add type test pre-req

* chore: install deps from examples in PR CI

* chore: remove filter from more installation
This commit is contained in:
Corbin Crutchley
2023-09-09 03:40:29 -07:00
committed by GitHub
parent b5a768f182
commit 160f71275f
14 changed files with 421 additions and 512 deletions

View File

@@ -28,10 +28,9 @@ export function useForm<TData>(opts?: FormOptions<TData>): FormApi<TData> {
// @ts-ignore
const api = new FormApi<TData>(opts)
// eslint-disable-next-line react/display-name
api.Provider = (props) => (
<formContext.Provider {...props} value={{ formApi: api }} />
)
api.Provider = function Provider(props) {
return <formContext.Provider {...props} value={{ formApi: api }} />
}
api.Field = Field as any
api.useField = useField as any
api.useStore = (