import React from 'react';
import DayPicker from '../../../src';

import '../../../src/style.css';

export default class DisabledDays extends React.Component {
  state = {
    selectedDay: null,
  };
  handleDayClick = (day, { disabled, selected }) => {
    if (disabled) {
      return;
    }
    this.setState({
      selectedDay: selected ? null : day,
    });
  };
  render() {
    const { selectedDay } = this.state;
    return (
      <div>
        <DayPicker
          enableOutsideDays
          selectedDays={selectedDay}
          disabledDays={day => day.getDay() === 0 || day.getDay() === 6}
          onDayClick={this.handleDayClick}
        />
        <p>
          {selectedDay
            ? selectedDay.toLocaleDateString()
            : 'Please select a day 👻'}
        </p>
      </div>
    );
  }
}

@@ -93,16 +93,130 @@
 .css';%0A%0A
+function sundays(day) %7B%0A  return day.getDay() === 0;%0A%7D%0A%0Afunction saturdays(day) %7B%0A  return day.getDay() === 6;%0A%7D%0A%0A
 export d
@@ -493,48 +493,8 @@
 ) %7B%0A
-    const %7B selectedDay %7D = this.state;%0A
     
@@ -585,16 +585,27 @@
 edDays=%7B
+this.state.
 selected
@@ -637,55 +637,28 @@
 ys=%7B
-day =%3E day.getDay() === 0 %7C%7C day.getDay() === 6
+%5Bsundays, saturdays%5D
 %7D%0A  
@@ -732,16 +732,27 @@
        %7B
+this.state.
 selected
@@ -769,16 +769,27 @@
       ? 
+this.state.
 selected

Make example’s code cleaner