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

[useMediaQuery][utils] Remove usage of React 18 APIs #29870

Merged
merged 4 commits into from
Nov 25, 2021

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Nov 24, 2021

Closes #29860

These new APIs aren't required for usage with React 18. The either fix some very rare bugs (tearing in useMediaQuery) or improve existing behavior (useId on the server).

However, in the meantime they disrupt usage with stable React releases which is not ok. Though until React 18 is stable, we need a workaround for webpack/webpack#14814.

A separate /compat entrypoint like react-redux will require a lot of work from our and consumer side so I don't think this'll be viable.

Ideally we'd just put this behind a feature flag instead of reverting but we don't have any infra for that.

@eps1lon eps1lon added bug 🐛 Something doesn't work external dependency Blocked by external dependency, we can’t do anything about it package: utils Specific to the @mui/utils package hook: useMediaQuery labels Nov 24, 2021
@eps1lon eps1lon marked this pull request as ready for review November 24, 2021 13:23
@eps1lon eps1lon force-pushed the fix/export-not-found branch from 0f6dc58 to 82b49ec Compare November 24, 2021 20:53
@mui-pr-bot
Copy link

mui-pr-bot commented Nov 24, 2021

Details of bundle changes

@material-ui/core: parsed: -0.12% 😍, gzip: -0.14% 😍
@material-ui/lab: parsed: -0.15% 😍, gzip: -0.17% 😍

Generated by 🚫 dangerJS against 26025e3

@eps1lon eps1lon force-pushed the fix/export-not-found branch from 82b49ec to 26025e3 Compare November 25, 2021 01:04
@eps1lon eps1lon merged commit 1f3f078 into mui:master Nov 25, 2021
@eps1lon eps1lon deleted the fix/export-not-found branch November 25, 2021 10:57
@eps1lon eps1lon mentioned this pull request Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work external dependency Blocked by external dependency, we can’t do anything about it hook: useMediaQuery package: utils Specific to the @mui/utils package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: "export 'useId' (imported as 'React') was not found in 'react'" after upgrading to v5.2.0
2 participants