Skip to content

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

@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: DateRangePicker The React component component: DateTimePicker The React component. component: TimePicker The React component. labels Jan 11, 2021
@eps1lon eps1lon added component: DateTimePicker The React component. component: DateRangePicker The React component component: TimePicker The React component. labels Jan 11, 2021
@oliviertassinari

This comment has been minimized.

@eps1lon

This comment has been minimized.

@eps1lon

This comment has been minimized.

@eps1lon eps1lon force-pushed the fix/lab-pickers-on-change branch from 9f5c508 to e8aef2a Compare January 12, 2021 07:37
@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: DatePicker The React component. component: DateRangePicker The React component component: DateTimePicker The React component. component: TimePicker The React component. performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants