Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 709 Bytes

SubmitButton.md

File metadata and controls

31 lines (23 loc) · 709 Bytes

SubmitButton

Button for submitting form.

SubmitButton should be wrapped into Form

Public interface

Props

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

Example

<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>