SingleDatePicker focused (react-dates) => returning an error

114 views Asked by At

The SingleDatePicker from react-dates returning an error: Invalid prop focused of type object supplied to withStyles(SingleDatePicker), expected boolean

Here the link: https://codesandbox.io/s/dazzling-mclaren-2w5q8?file=/src/App.js

1

There are 1 answers

0
Matteobikk90 On

apparently this solved the issue:

 const onFocusChange = ({ focused }) => {
    setFocused(focused);
 };

<SingleDatePicker
  onFocusChange={onFocusChange}
/>