How to use the react-day-picker/lib/src/DayPicker.defaultProps function in react-day-picker

To help you get started, we’ve selected a few react-day-picker 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 OpusCapita / react-dates / src / client / components / DayPicker / DayPicker.react.js View on Github external
className: PropTypes.string,
  dayPickerRef: PropTypes.func,
  getTodayButtonLabel: PropTypes.func,
  hideTodayButton: PropTypes.bool,
  isRange: PropTypes.bool,
  onChange: PropTypes.func,
  pickerClassName: PropTypes.string
};

let defaultProps = {
  className: '',
  dayPickerRef: () => {},
  getTodayButtonLabel: (locale) => getMessage(locale, 'today'),
  hideTodayButton: false,
  isRange: false,
  labels: ReactDayPicker.defaultProps.labels,
  onChange: () => {},
  pickerClassName: ''
};

export default
class DayPicker extends Component {
  constructor(props) {
    super(props);
    this.state = {
      date: props.date,
      monthToDisplay: props.date
    };
  }

  handleCaptionChange = ({ month, year, captionIndex }) => {
    let monthToDisplay = captionIndex === 0 ?