I am using renderArrow in Calendar component to render Custom Arrow Icons. I am hiding right and left arrows on certain conditions for example : when maxDate is reached the right arrow is not needed. On such occasion the right arrow is not rendering but while pressing the empty area where the right arrow renders the months are getting changed
once maxDate reached right arrow should not be rendered and future month navigation should not be done.
once maxDate reached right arrow is not rendering but while clicking on the empty area next month navigation is happening
My code :
renderArrow = {
( direction ) =>
{
if ( direction == 'left' && this.state.prevMonthAvailable ) return ( < Icon name = 'chevron-left'
size = {
30
}
color = {
colors.blue
}
/>);
if ( direction == 'right' && this.state.nextMonthAvailable ) return ( < Icon name = 'chevron-right'
size = {
30
}
color = {
colors.blue
}
/>);
}
}
onMonthChange = {
( month ) =>
{
if ( moment( month.dateString ).isAfter( this.state.maxDate ) )
{
this.setState(
{
nextMonthAvailable: false
} )
}
}
}

@telltokichu Solved ? how to achieve maxMonth?
Now you can use renderArrow with syntax as below:
renderArrow={(direction) => direction === 'left' ? <IconLeft> : < IconRight/>}
Most helpful comment
Now you can use renderArrow with syntax as below:
renderArrow={(direction) => direction === 'left' ? <IconLeft> : < IconRight/>}