Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IAsyncButtonProps

Hierarchy

  • IAsyncButtonProps

Index

Properties

Optional DisabledComponent

DisabledComponent: Component<IAsyncButtonComponentState>

The component that will be rendered when the button is disabled

Optional FailureComponent

FailureComponent: Component<IAsyncButtonComponentState>

Rendered when the asynchronous operation has returned an failure. Will be shown for failureTimeout before resetting back to the idle state. Defaults to the ProcessingComponent

IdleComponent

IdleComponent: Component<IAsyncButtonComponentState>

The component that will be rendered when the button is idle

Optional ProcessingComponent

ProcessingComponent: Component<IAsyncButtonComponentState>

Rendered when the asynchronous operation is in flight, defaults to ActivityIndicator

Optional SuccessComponent

SuccessComponent: Component<IAsyncButtonComponentState>

Rendered when the asynchronous operation has successfully completed. Will be shown for successTimeout before resetting back to the idle state. Defaults to the ProcessingComponent

Optional disabled

disabled: undefined | false | true

Determines if the button is enabled or not

Optional disabledOpacity

disabledOpacity: undefined | number

The opacity to be applied to the disabled component, defaults to 0.6

Optional failureTimeout

failureTimeout: Milliseconds

The amount of time that the failure component will be shown. Can be set to Infinity to show the failure component with no reset. The button can be explicitly reset with Button.reset if needed.

Optional onComplete

onComplete: Callback

Invoked when the button has completed the asynchronous operation

Optional onFailure

onFailure: Callback

Invoked when the asynchronous operation created an failure

Optional onProcessing

onProcessing: Callback

Invoked when the user has requested the asynchronous operation to occur

Optional onSuccess

onSuccess: Callback

Invoked when the asynchronous function successfully completed

Optional style

style: StyleProp<ViewStyle>

The style for the component

Optional successTimeout

successTimeout: Milliseconds

The amount of time that the success component will be shown after a successful asynchronous operation. Can be set to Infinity to show the success component with no reset which is useful for single asynchronous operation such as submitting data. The button can be explicitly reset with Button.reset if needed.

Optional theme

theme: ITheme

The theme to use to style the button

Methods

onPress

  • onPress(): Promise<void>