How to use the @material/snackbar/foundation.MDCSnackbarFoundation function in @material/snackbar

To help you get started, we’ve selected a few @material/snackbar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github material-components / material-components-web-react / packages / snackbar / index.tsx View on Github external
super(props);
    const {timeoutMs, closeOnEscape, leading, stacked} = this.props;
    const classes = new Set();
    if (leading) {
      classes.add('mdc-snackbar--leading');
    }

    if (stacked) {
      classes.add('mdc-snackbar--stacked');
    }

    this.state = {
      classes,
    };

    this.foundation = new MDCSnackbarFoundation(this.adapter);
    if (timeoutMs) {
      this.foundation.setTimeoutMs(timeoutMs);
    }

    if (closeOnEscape) {
      this.foundation.setCloseOnEscape(closeOnEscape);
    }
  }
  get adapter(): MDCSnackbarAdapter {