title: react-native-calendar : selected ON/OFF when date is selected
body: <p>I am using <a href="https://github.com/wix/react-native-calendars" rel="nofollow noreferrer">react-native-calendar</a> for my project. I can <code>mark on</code> the calendar when I press on a date. But I want to <code>mark off</code> when marked date is pressed again.</p>
  <p>This is my function code:</p>
  <pre><code> onDayPress = (day) =&gt; {
          const _selectedDay = Moment(day.dateString).format(_format);
          this.setState(({pressedDate}) =&gt; ({
           pressedDate: {
            ...pressedDate,
            [_selectedDay] : {
            selected: true
            }
         },
         selectedDay:_selectedDay
       }))
       console.log(this.state.pressedDate, 'this.state.pressedDate')
      }
  </code></pre>
  <p>In my calendar</p>
  <pre><code>&lt;Calendar
             style={styles.calendarBox}
             markedDates={this.state.pressedDate}
             onDayPress={this.onDayPress}
             markingType={'multi-dot'}
             monthFormat={'yyyy MMMM'}/&gt;
  </code></pre>
  <p>Is there a way I can mark on and off dates? Also, I want only to mark up to three dates. Is this possible?</p>
  <p>Also, when I <code>console.log('this.state.pressedDate')</code> I get undefined at first. When I click on it again then I get the value any idea why this is happening?.</p>