Skip to content

Commit a6b0a2e

Browse files
Fixed re-rendering issue in Calendar component (#300)
* Fixed re-rendering issue in <Calendar/> component The `onMouseLeave` prop of `<MonthView/>` should be `null` when `selectRange` is not set. It is causing unnecessary re-rendering of the whole `<Calendar/>` component on the hover of `<Weekdays/>` component (child of `<MonthView/>` ) due to fire of the `onMouseOver` event passed in its child `<Flex/>` . * Remove unnecessary prop Co-authored-by: Wojciech Maj <[email protected]>
1 parent 254b0cf commit a6b0a2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Calendar.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ export default class Calendar extends Component {
523523
formatLongDate={formatLongDate}
524524
formatShortWeekday={formatShortWeekday}
525525
onClickWeekNumber={onClickWeekNumber}
526-
onMouseLeave={onMouseLeave}
526+
onMouseLeave={selectRange ? onMouseLeave : null}
527527
showFixedNumberOfWeeks={showFixedNumberOfWeeks || showDoubleView}
528528
showNeighboringMonth={showNeighboringMonth}
529529
showWeekNumbers={showWeekNumbers}

0 commit comments

Comments
 (0)