Skip to content

Fixed re-rendering issue in Calendar component #300

New issue

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

Merged
merged 2 commits into from
May 15, 2020

Conversation

UtkarshPramodGupta
Copy link
Contributor

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/> .

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/>` .
@wojtekmaj wojtekmaj changed the title Fixed re-rendering issue in <Calendar/> component Fixed re-rendering issue in Calendar component May 15, 2020
@wojtekmaj
Copy link
Owner

Good catch - thank you!

@wojtekmaj wojtekmaj merged commit a6b0a2e into wojtekmaj:master May 15, 2020
felixmosh pushed a commit to felixmosh/react-calendar that referenced this pull request Nov 8, 2020
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants