Warning: Failed prop type on SingleDatePicker
See original GitHub issueHello,
I got issue Warning: Failed prop type on SingleDatePicker when using SingleDatePicker on react-dates:

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:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Closing, in favor of https://github.com/developit/preact/issues/762
got it @ljharb look like it related to issue on
preacthere . Thanks for the advice 👌