We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In the Code Sandbox link below, if you set react-month-picker version greater than or equal to 2.0.1, show prop doesn't work anymore.
https://codesandbox.io/s/holy-lake-636cb?file=/src/index.js
The text was updated successfully, but these errors were encountered:
That's what it seems like to me. You will need to call the show() method via refs. For example:
show()
import React from 'react'; import MonthPicker from 'react-month-picker'; const Example = () => { const [yearMonth, setYearMonth] = React.useState({ year: 2020, month: 9 }); const monthPickerRef = React.useRef<MonthPicker>(null); const showPicker = () => { if (monthPickerRef && monthPickerRef.current) { monthPickerRef.current.show(); } }; const handlePickerChange = (year: number, month: number) => { setYearMonth({ year, month }); }; return ( <MonthPicker ref={monthPickerRef} value={yearMonth} onChange={handlePickerChange} > <span onClick={showPicker}> {yearMonth.month} {yearMonth.year} </span> </MonthPicker> ); };
Sorry, something went wrong.
No branches or pull requests
In the Code Sandbox link below, if you set react-month-picker version greater than or equal to 2.0.1, show prop doesn't work anymore.
https://codesandbox.io/s/holy-lake-636cb?file=/src/index.js
The text was updated successfully, but these errors were encountered: