import React, { PureComponent } from 'react';
import PropTypes from './PropTypes';
import defaultClassNames from './classNames';

export default class Navbar extends PureComponent {
  static defaultProps = {
    classNames: defaultClassNames,
    dir: 'ltr',
    labels: {
      previousMonth: 'Previous Month',
      nextMonth: 'Next Month',
    },
    showPreviousButton: true,
    showNextButton: true,
  };
  render() {
    const {
      classNames,
      className,
      showPreviousButton,
      showNextButton,
      onPreviousClick,
      onNextClick,
      labels,
      dir,
    } = this.props;
    const previousClickHandler = dir === 'rtl' ? onNextClick : onPreviousClick;
    const nextClickHandler = dir === 'rtl' ? onPreviousClick : onNextClick;

    const previousButton =
      showPreviousButton &&
      <span
        tabIndex="0"
        role="button"
        aria-label={labels.previousMonth}
        key="previous"
        className={classNames.navButtonPrev}
        onClick={() => previousClickHandler()}
      />;

    const nextButton =
      showNextButton &&
      <span
        tabIndex="0"
        role="button"
        aria-label={labels.nextMonth}
        key="right"
        className={classNames.navButtonNext}
        onClick={() => nextClickHandler()}
      />;

    return (
      <div className={className || classNames.navBar}>
        {dir === 'rtl'
          ? [nextButton, previousButton]
          : [previousButton, nextButton]}
      </div>
    );
  }
}

export const NavbarPropTypes = {
  classNames: PropTypes.shape({
    navBar: PropTypes.string.isRequired,
    navButtonPrev: PropTypes.string.isRequired,
    navButtonNext: PropTypes.string.isRequired,
  }),
  className: PropTypes.string,
  showPreviousButton: PropTypes.bool,
  showNextButton: PropTypes.bool,
  onPreviousClick: PropTypes.func,
  onNextClick: PropTypes.func,
  dir: PropTypes.string,
  labels: PropTypes.shape({
    previousMonth: PropTypes.string.isRequired,
    nextMonth: PropTypes.string.isRequired,
  }),
};

Navbar.propTypes = NavbarPropTypes;

@@ -9,20 +9,16 @@
 eact, %7B 
-Pure
 Componen
@@ -35,16 +35,16 @@
 react';%0A
+
 import P
@@ -159,12 +159,8 @@
 nds 
-Pure
 Comp
@@ -395,13 +395,256 @@
 ue,%0A
-
   %7D;%0A
+  shouldComponentUpdate(nextProps) %7B%0A    return (%0A      nextProps.labels !== this.props.labels %7C%7C%0A      this.props.showPreviousButton !== nextProps.showPreviousButton %7C%7C%0A      this.props.showNextButton !== nextProps.showNextButton%0A    );%0A  %7D%0A%0A
   re

Use shouldComponentUpdate in Navbar