Button for submitting form.
SubmitButton
should be wrapped into Form
SubmitButton
contains html <button />
element. All props for <button />
are valid for SubmitButton
.
Own props:
loadingClassname
- class that applies while submit. By default -is-loading
.loadingComponent
- component that will render while submit.Optional
<Form
onSubmit={async (values) => await someRequest(values)}
validator={new SchemaValidator(ExampleSchema)}
errorParser={(error) => myCustomParser(error)}
>
<SubmitButton loadingComponent={<span>wait...</span>}>
<span>
submit
</span>
</SubmitButton>
</Form>