Back to React Native Paper

Dialog.Actions

docs/public/2.0/dialog-actions.html

5.15.1845 B
Original Source

Dialog.Actions

A component to show a list of actions in a Dialog.

Usage

js
import * as React from 'react';
import { Button, Dialog, Portal } from 'react-native-paper';

export default class MyComponent extends React.Component {
  state = {
    visible: false,
  };

  _hideDialog = () => this.setState({ visible: false });

  render() {
    return (
      <Portal>
        <Dialog
          visible={this.state.visible}
          onDismiss={this._hideDialog}>
          <Dialog.Actions>
            <Button onPress={() => console.log("Cancel")}>Cancel</Button>
            <Button onPress={() => console.log("Ok")}>Ok</Button>
          </Dialog.Actions>
        </Dialog>
      </Portal>
    );
  }
}

Props

children (required) Type: React.Node

Content of the DialogActions.

style Type: any