简体   繁体   English

SingleDatePicker 聚焦 (react-dates) => 返回错误

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

The SingleDatePicker from react-dates returning an error: Invalid prop focused of type object supplied to withStyles(SingleDatePicker) , expected boolean来自 react-dates 的 SingleDatePicker 返回错误:Invalid focused of type object提供给withStyles(SingleDatePicker) ,预期boolean

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

apparently this solved the issue:显然这解决了这个问题:

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

<SingleDatePicker
  onFocusChange={onFocusChange}
/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM