question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning: Failed prop type on SingleDatePicker

See original GitHub issue

Hello,

I got issue Warning: Failed prop type on SingleDatePicker when using SingleDatePicker on react-dates: screen shot 2018-11-07 at 11 00 47 am

Here my code:

import 'react-dates/initialize'
import { SingleDatePicker } from 'react-dates'

// Styles
import 'react-dates/lib/css/_datepicker.css'
import '../../../assets/styles/custom_datepicker.css'

<SingleDatePicker
          isOutsideRange={
            isEnableDateRange
              ? day => handleGetOutsideRangeDates(day)
              : this.handleGetDefaultOutSideRange
          }
          date={calendarDate ? moment(calendarDate) : calendarDate}
          onDateChange={date => handleGetPeriod(id, date)}
          focused={this.state.focused}
          onFocusChange={({ focused }) => this.setState({ focused })}
          id={id}
          inputIconPosition={ICON_AFTER_POSITION}
          placeholder={placeholder}
          displayFormat={`DD/MM/YYYY`}
          numberOfMonths={1}
          showDefaultInputIcon={false}
          customInputIcon={
            <LinkIcon {...calendarIconStyles} disabled={disabled} />
          }
          disabled={disabled}
          daySize={22}
          monthFormat={'MMM, YYYY'}
          firstDayOfWeek={1}
          readOnly={readOnly}
        />

These errors happen on both react-dates v16.7.0 and v18.2.1. I have research on issues but can’t find solution for it. Anyone can help me?

Thanks,

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ljharbcommented, Nov 7, 2018
1reaction
tuanluu-agilityiocommented, Nov 7, 2018

got it @ljharb look like it related to issue on preact here . Thanks for the advice 👌

Read more comments on GitHub >

github_iconTop Results From Across the Web

Warning: Failed prop type on SingleDatePicker #1454 - GitHub
Hello, I got issue Warning: Failed prop type on SingleDatePicker when using SingleDatePicker on react-dates: Here my code: import ...
Read more >
reactjs - Warning: Failed prop type: Invalid prop `focused` of ...
log(calendarFocused), it will print an object [focused : false] to the console. As SingleDatePicker expects a boolean, this will throw an error.
Read more >
Don't Call PropTypes Warning - React
Once this happens, any code that calls these functions manually (that isn't stripped in production) will throw an error. Declaring PropTypes is still...
Read more >
Invalid props.style key 'textAlign' supplied to 'View'-Reactjs
Coding example for the question Failed prop type: Invalid props.style key 'textAlign' supplied to 'View'-Reactjs.
Read more >
[REACT] (SingleDatePicker) Warning: Failed prop type
[REACT] (SingleDatePicker) Warning: Failed prop type: Invalid prop `date` of typ. 개발_메모장 2021. 9. 14. 19:22. <SingleDatePicker id={id} ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found