You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
+ // The ref is coming from a React.forwardRef. It might not exist. Since React 19 handles ref as prop, only define it if there is a value.+ if (ref) {
newProps.ref = ref;
+ }
since emotion is only trying to be transparent from a ref perspective, with it's styled() wrapper.
Ah god, I should default to StackBlitz. Fixed. CodeSandbox fixed a bit it's UX recently by showing the sandbox visibility setting with an icon, but I keep forgetting about it (so are people on Material UI). There should be a setting to configure a default mode in CodeSandbox.
To reproduce:
Current behavior:
React 19.0.0-rc.0 fail: https://codesandbox.io/p/sandbox/blissful-danilo-3z4rs3?file=%2Fsrc%2Findex.js%3A1%2C1-35%2C1
Expected behavior:
React 18.3.1 success: https://codesandbox.io/p/sandbox/peaceful-jones-fqj8kw?file=%2Fpackage.json%3A5%2C12&workspaceId=836800c1-9711-491c-a89b-3ac24cbd8cd8
Environment information:
react
version: 19.0.0-rc.0@emotion/react
version: 11.11.5Context
I have noticed this from mui/material-ui#41388. React 19 handles ref as prop by default https://react.dev/blog/2024/04/25/react-19#ref-as-a-prop. So when emotion does
emotion/packages/styled/src/base.js
Line 160 in 4cc565f
The right solution seems to do:
since emotion is only trying to be transparent from a ref perspective, with it's
styled()
wrapper.emotion/packages/react/src/context.js
Line 35 in 4cc565f
The text was updated successfully, but these errors were encountered: