-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[pickers] Unify PickersMonth
and PickersYear
behaviors
#6034
Conversation
PickersYear
behaviors
PickersYear
behaviorsPickersMonth
and PickersYear
behaviors
These are the results for the performance tests:
|
if (onMonthFocus) { | ||
onMonthFocus(month); | ||
} | ||
const focusMonth = useEventCallback((month: number) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used useEventCallback
everywhere because we don't have any useEffect
listening to callback changes.
And we are passing callbacks to child component and so we were re-rendering every month / year each time those callbacks changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does no seems to introduce any regression 👌
I have an Argos diff, I'll see if we want to exactly replicate the old UI |
I think the diff makes sense |
Fixes #5465
Fixes #4459
PickersMonth
andPickersYear
MonthPicker
andYearPicker
MonthPicker
andYearPicker
(requires removing the...other
props toYearPicker
inCalendarPicker
)@alexfauquette I hope I did not introduce any regression in your recent improvements.