File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11( ) => {
22 const [ startDate , setStartDate ] = useState ( new Date ( ) ) ;
3+ const monthsShown = useMemo ( ( ) => 2 , [ ] ) ;
34 return (
45 < DatePicker
56 renderCustomHeader = { ( {
1415 className = {
1516 "react-datepicker__navigation react-datepicker__navigation--previous"
1617 }
17- style = { customHeaderCount === 1 ? { visibility : " hidden" } : null }
18+ style = { { visibility : customHeaderCount === 0 ? 'visible' : ' hidden' } }
1819 onClick = { decreaseMonth }
1920 >
2021 < span
3637 className = {
3738 "react-datepicker__navigation react-datepicker__navigation--next"
3839 }
39- style = { customHeaderCount === 0 ? { visibility : " hidden" } : null }
40+ style = { { visibility : customHeaderCount === monthsShown - 1 ? 'visible' : ' hidden' } }
4041 onClick = { increaseMonth }
4142 >
4243 < span
5152 ) }
5253 selected = { startDate }
5354 onChange = { ( date ) => setStartDate ( date ) }
54- monthsShown = { 2 }
55+ monthsShown = { monthsShown }
5556 />
5657 ) ;
5758} ;
You can’t perform that action at this time.
0 commit comments