How to use the @material/tab-bar/dist/mdc.tabBar.MDCTabBarFoundation function in @material/tab-bar

To help you get started, we’ve selected a few @material/tab-bar 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 / tab-bar / index.js View on Github external
componentDidMount() {
    this.foundation_ = new MDCTabBarFoundation(this.adapter);
    this.foundation_.init();

    const {
      activeIndex,
      indexInView,
    } = this.props;
    if (this.tabList_[activeIndex]) {
      this.tabList_[activeIndex].activate({} /* previousIndicatorClientRect */);
    }
    this.foundation_.scrollIntoView(indexInView);
  }