title: how to disable some dates in react-calendar
body: <p>Could someone tell me how to pass an array of disabled dates to the calendar?</p>
  <p>I searched but couldn't find how to do it</p>
  <p><a href="https://www.npmjs.com/package/react-calendar" rel="nofollow noreferrer">https://www.npmjs.com/package/react-calendar</a></p>
  <pre><code>import React, { useState, useEffect} from 'react';
  import Api from '../../services/api';
  import Calendar from 'react-calendar';
  import { useParams } from &quot;react-router-dom&quot;;
  import 'react-calendar/dist/Calendar.css';
  
  function MyApp() {
    const { id } = useParams();
    const [value, onChange] = useState(new Date());
    const [disabledDates, setDisabledDates] = useState([]);
  
    useEffect(() =&gt; {
      loadDisabledDates();
    }, []);
  
    function loadDisabledDates()
    {
      Api
        .get(&quot;/dates/&quot;+id)
        .then((response) =&gt; {
          setDisabledDates(response.data);
        })
        .catch((err) =&gt; {
          console.error(&quot;error: &quot; + err);
        });
    }
  
    return (
      &lt;div&gt;
        &lt;Calendar onChange={onChange} value={value} /&gt;
      &lt;/div&gt;
    );
  }
  </code></pre>