fix: several type and build errors and fix example type inference (#399)

* fix few type errors and fix example

* couple fixes

* fix babel
This commit is contained in:
Brandon Bayer
2023-06-13 17:36:42 -04:00
committed by GitHub
parent bebd998a55
commit a3f9709dde
7 changed files with 24 additions and 15 deletions

View File

@@ -57,7 +57,7 @@ export function useForm<TData>(opts?: FormOptions<TData>): FormApi<TData> {
selector,
) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
return useStore(api.store, selector) as any
return useStore(api.store as any, selector as any) as any
}
api.Subscribe = (
// @ts-ignore
@@ -66,7 +66,7 @@ export function useForm<TData>(opts?: FormOptions<TData>): FormApi<TData> {
return functionalUpdate(
props.children,
// eslint-disable-next-line react-hooks/rules-of-hooks
useStore(api.store, props.selector),
useStore(api.store as any, props.selector as any),
) as any
}