handleKeyboardEvent(e) {
    const { btnIds } = this.state;
    const keys = {
      end: 35,
      home: 36,
      left: 37,
      right: 39,
    };

    switch (e.keyCode) {
      case keys.left:
        this.retreatTab();
        break;
      case keys.right:
        this.advanceTab();
        break;
      case keys.home:
        this.setState({
          isActive: btnIds[0],
          isFocused: btnIds[0],
        });
        break;
      case keys.end:
        this.setState({
          isActive: btnIds[btnIds.length - 1],
          isFocused: btnIds[btnIds.length - 1],
        });
        break;
      default:
        break;
    }
  }
/*
   * Tabs uses arrow keys to move from tab to tab.
   * Depending on the key pressed we need to
   * set a new active tab.
   */
Tabs uses arrow keys to move from tab to tab.
Depending on the key pressed we need to
set a new active tab.
Tabs uses arrow keys to move from tab to tab . Depending on the key pressed we need to set a new active tab .
handleKeyboardEvent(e) {
    const { btnIds } = this.state;
    const keys = {
      end: 35,
      home: 36,
      left: 37,
      right: 39,
    };
    switch (e.keyCode) {
      case keys.left:
        this.retreatTab();
        break;
      case keys.right:
        this.advanceTab();
        break;
      case keys.home:
        this.setState({
          isActive: btnIds[0],
          isFocused: btnIds[0],
        });
        break;
      case keys.end:
        this.setState({
          isActive: btnIds[btnIds.length - 1],
          isFocused: btnIds[btnIds.length - 1],
        });
        break;
      default:
        break;
    }
  }
handleKeyboardEvent ( e ) { const { btnIds } = this . state ; const keys = { end : 35 , home : 36 , left : 37 , right : 39 , } ; switch ( e . keyCode ) { case keys . left : this . retreatTab ( ) ; break ; case keys . right : this . advanceTab ( ) ; break ; case keys . home : this . setState ( { isActive : btnIds [ 0 ] , isFocused : btnIds [ 0 ] , } ) ; break ; case keys . end : this . setState ( { isActive : btnIds [ btnIds . length - 1 ] , isFocused : btnIds [ btnIds . length - 1 ] , } ) ; break ; default : break ; } }
Tabs uses arrow keys to move from tab to tab.
Tabs uses arrow keys to move from tab to tab .