remix-forms
Advanced tools
Comparing version 1.6.0 to 1.6.1
@@ -142,9 +142,14 @@ import * as React$1 from 'react'; | ||
declare type OnTransition<Schema extends SomeZodObject> = (helpers: UseFormReturn<z.infer<Schema>, any>) => void; | ||
declare type SubmitFunction = ({ target }: { | ||
declare type LegacySubmitFunction = (event: { | ||
target: any; | ||
}) => void; | ||
declare type SubmitFunction = (event: { | ||
target: any; | ||
}, options?: { | ||
preventScrollReset?: boolean; | ||
}) => void; | ||
declare type FetcherWithComponents = Transition & { | ||
data: any; | ||
Form: FormComponent; | ||
submit: SubmitFunction; | ||
submit: SubmitFunction | LegacySubmitFunction; | ||
}; | ||
@@ -180,3 +185,3 @@ declare type FormProps<Schema extends FormSchema> = ComponentMappings & { | ||
useNavigation: () => Transition; | ||
useSubmit: () => SubmitFunction; | ||
useSubmit: (() => SubmitFunction) | (() => LegacySubmitFunction); | ||
useActionData: () => unknown; | ||
@@ -183,0 +188,0 @@ }): <Schema extends FormSchema<SomeZodObject | z.ZodEffects<any, any, any>>>({ component, fetcher, mode, reValidateMode, renderField, fieldComponent, globalErrorsComponent: Errors, errorComponent: Error, fieldErrorsComponent, labelComponent, inputComponent, multilineComponent, selectComponent, checkboxComponent, radioComponent, checkboxWrapperComponent, radioGroupComponent, radioWrapperComponent, buttonComponent: Button, buttonLabel: rawButtonLabel, pendingButtonLabel, method, schema, beforeChildren, onTransition, parseActionData, children: childrenFn, labels, placeholders, options, hiddenFields, multiline, radio, autoFocus: autoFocusProp, errors: errorsProp, values: valuesProp, ...props }: FormProps<Schema>) => JSX.Element; |
@@ -709,3 +709,5 @@ "use strict"; | ||
const onSubmit = (event) => { | ||
form.handleSubmit(() => submit(event.target))(event); | ||
form.handleSubmit( | ||
() => submit(event.target, { preventScrollReset: props.preventScrollReset }) | ||
)(event); | ||
}; | ||
@@ -712,0 +714,0 @@ const formRef = React3.useRef(null); |
{ | ||
"name": "remix-forms", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "The full-stack form library for Remix and React Router", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
77295
2145