Table of Contents

Method SubmitAsync

Namespace
Velvet
Assembly
Velvet.Docs.dll

SubmitAsync(object?, SubmitOptions?, CancellationToken)

Submits formData as React Router's router.navigate(to, { formMethod, formData }) does; routing.md owns what each method does. A get submission navigates with the form data as its query string. Another form method calls the action of the route the target path matches, reporting Submitting while it runs, and commits its result for UseActionData or its failure as that route's error. A method no form takes commits React Router's 405 error.

public VelvetTask<NavigationResult> SubmitAsync(object? formData, SubmitOptions? options = null, CancellationToken cancellationToken = default)

Parameters

formData object

What the submission sends. A get submission encodes the body as routing.md lists, in order, as its query string; a body that cannot be encoded commits an error in the navigation.

options SubmitOptions

How to submit; null takes every default. A null Action submits to the current location.

cancellationToken CancellationToken

Token forwarded to the action and the loaders.

Returns

VelvetTask<NavigationResult>

The outcome, as NavigateAsync(string, NavigationMode, CancellationToken) reports it. A failure an action or a method commits reports Success.