Skip to content
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

[lab] Reflect draft pattern of picker value in implementation #24367

Merged
merged 3 commits into from
Jan 14, 2021

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Jan 11, 2021

Based on #24366 (diff)

I originally misidentified that usePickerState needs getDerivedStateFromProps. I believe now that usePickerState implements the draft pattern but the previous implementation used useEffect. However, that pattern can be implemented without needing to commit twice. The React docs go over this in more detail: https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html#recap (look for usage of "draft").

We still have cascading updates (https://mui-dashboard.netlify.app/test-profile/212342/details/%3CDatePicker%20%2F%3E%20render%20proper%20month).

Latest test_profile on next: https://mui-dashboard.netlify.app/test-profile/212357
Latest test_profile on this PR: https://mui-dashboard.netlify.app/test-profile/212342

@eps1lon eps1lon added performance component: date picker This is the name of the generic UI component, not the React module! component: time picker This is the name of the generic UI component, not the React module! component: date time picker This is the name of the generic UI component, not the React module! component: date range picker This is the name of the generic UI component, not the React module! labels Jan 11, 2021
@mui-pr-bot
Copy link

mui-pr-bot commented Jan 11, 2021

Details of bundle changes

Generated by 🚫 dangerJS against e8aef2a

@oliviertassinari oliviertassinari removed component: date range picker This is the name of the generic UI component, not the React module! component: date time picker This is the name of the generic UI component, not the React module! component: time picker This is the name of the generic UI component, not the React module! labels Jan 11, 2021
@eps1lon eps1lon added component: date time picker This is the name of the generic UI component, not the React module! component: date range picker This is the name of the generic UI component, not the React module! component: time picker This is the name of the generic UI component, not the React module! labels Jan 11, 2021
@oliviertassinari

This comment has been minimized.

@eps1lon

This comment has been minimized.

@eps1lon

This comment has been minimized.

@eps1lon eps1lon marked this pull request as ready for review January 12, 2021 14:17
@eps1lon
Copy link
Member Author

eps1lon commented Jan 14, 2021

Went over this again and again. Worst case scenario is that it will reveal some code that relies on cascading updates.

@eps1lon eps1lon merged commit 311444c into mui:next Jan 14, 2021
@eps1lon eps1lon deleted the fix/lab-pickers-on-change branch January 14, 2021 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: date picker This is the name of the generic UI component, not the React module! component: date range picker This is the name of the generic UI component, not the React module! component: date time picker This is the name of the generic UI component, not the React module! component: time picker This is the name of the generic UI component, not the React module! performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants