Skip to content

Commit

Permalink
fix: 🐛 Adds second generic to useInertiaInput type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
aviemet committed Dec 16, 2023
1 parent f05b650 commit bcf3d39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ export { default as useInertiaForm, type UseInertiaFormProps, type NestedObject
export { default as useInertiaInput } from './useInertiaInput'
export { default as useDynamicInputs } from './useDynamicInputs'
export {
Form,
useForm,
type HTTPVerb,
type UseFormProps,
type FormProps,
Form,
useForm,
type HTTPVerb,
type UseFormProps,
type FormProps,
} from './Form'
export { default as NestedFields, type NestedFieldsProps } from './NestedFields'
export { default as DynamicInputs, type DynamicInputsProps } from './Inputs/DynamicInputs'
Expand Down
4 changes: 2 additions & 2 deletions src/useInertiaInput/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ interface UseInertiaInputProps {
/**
* Returns form data and input specific methods to use with an input.
*/
const useInertiaInput = <T = number|string>({ name, model, errorKey, strategy = inputStrategy }: UseInertiaInputProps) => {
const form = useForm()
const useInertiaInput = <T = number|string, TForm = unknown>({ name, model, errorKey, strategy = inputStrategy }: UseInertiaInputProps) => {
const form = useForm<TForm>()

let usedModel = model ?? form.model

Expand Down

0 comments on commit bcf3d39

Please sign in to comment.