SubmitOptions
react-router

SubmitOptions interface

Submit options available to navigations

Properties

action

Type: string

The action URL path used to submit the form. Overrides <form action>. Defaults to the path of the current route.

encType

Type: FormEncType

The encoding used to submit the form. Overrides <form encType>. Defaults to "application/x-www-form-urlencoded".

fetcherKey

Type: string

Indicate a specific fetcherKey to use when using navigate=false

flushSync

Type: boolean

Enable flushSync for this submission's state updates

method

Type: HTMLFormMethod

The HTTP method used to submit the form. Overrides <form method>. Defaults to "GET".

Type: boolean

navigate=false will use a fetcher instead of a navigation

preventScrollReset

Type: boolean

In browser-based environments, prevent resetting scroll after this navigation when using the component

relative

Type: RelativeRoutingType

Determines whether the form action is relative to the route hierarchy or the pathname. Use this if you want to opt out of navigating the route hierarchy and want to instead route based on /-delimited URL segments

replace

Type: boolean

Set true to replace the current entry in the browser's history stack instead of creating a new one (i.e. stay on "the same page"). Defaults to false.

state

Type: any

State object to add to the history stack entry for this navigation

viewTransition

Type: boolean

Enable view transitions on this submission navigation

Docs and examples CC 4.0