Skip to content

Commit

Permalink
Merge pull request #412 from ZipBrandon/feature/viewTransitions
Browse files Browse the repository at this point in the history
Adding viewTransition to the useForm
  • Loading branch information
airjp73 authored Dec 20, 2024
2 parents 91d2b8e + 1919ebf commit c4b16d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/react-router/src/ValidatedForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const ValidatedForm = <
navigate,
otherFormProps,
reloadDocument,
viewTransition,
...rest
}: ValidatedFormProps<FormInputData, FormOutputData, FormResponseData>) => {
const rvf = useForm<FormInputData, FormOutputData>({
Expand All @@ -77,6 +78,7 @@ export const ValidatedForm = <
otherFormProps,
reloadDocument,
defaultValues,
viewTransition,
fetcher,
} satisfies AllProps<RemixFormOpts<FormInputData, FormOutputData>>);

Expand Down
2 changes: 2 additions & 0 deletions packages/react-router/src/useForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export type RemixFormOpts<
| "navigate"
| "preventScrollReset"
| "relative"
| "viewTransition"
> &
FormSubmitOpts<FormOutputData, void> & {
fetcher?: FetcherWithComponents<unknown>;
Expand Down Expand Up @@ -134,6 +135,7 @@ export function useForm<FormInputData extends FieldValues, FormOutputData>(
replace: rvfOpts.replace,
preventScrollReset: rvfOpts.preventScrollReset,
relative: rvfOpts.relative,
viewTransition: rvfOpts.viewTransition,
action: getFormAction(),

// Technically not type safe, but it isn't really possible to make it so.
Expand Down

0 comments on commit c4b16d3

Please sign in to comment.