Skip to content

Commit

Permalink
Merge branch 'main' into react-18.2-types
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown authored Jul 19, 2024
2 parents 8c602ad + 56109e7 commit 7b6928e
Show file tree
Hide file tree
Showing 7 changed files with 237 additions and 355 deletions.
3 changes: 2 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.6.0/schema.json",
"$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "emotion-js/emotion" }
Expand All @@ -23,6 +23,7 @@
]
],
"access": "public",
"privatePackages": false,
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
Expand Down
7 changes: 7 additions & 0 deletions .changeset/metal-boxes-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@emotion/primitives-core': patch
'@emotion/styled': patch
'@emotion/react': patch
---

Only forward defined `ref`s to improve compatibility with the upcoming React 19
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@
"@babel/preset-typescript": "^7.18.6",
"@babel/register": "^7.17.7",
"@babel/runtime": "^7.18.3",
"@changesets/changelog-github": "^0.4.0",
"@changesets/cli": "^2.16.0",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.7",
"@manypkg/cli": "^0.19.1",
"@preconstruct/cli": "^2.6.2",
"@testing-library/react": "13.0.0-alpha.5",
Expand Down
5 changes: 3 additions & 2 deletions packages/primitives-core/src/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ export function createStyled(
newProps[key] = props[key]
}
}

newProps.style = [css.apply(mergedProps, styles), props.style]
newProps.ref = ref
if (ref) {
newProps.ref = ref
}

return React.createElement(finalTag, newProps)
})
Expand Down
4 changes: 3 additions & 1 deletion packages/react/src/emotion-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,10 @@ let Emotion = /* #__PURE__ */ withEmotionCache(
newProps[key] = props[key]
}
}
newProps.ref = ref
newProps.className = className
if (ref) {
newProps.ref = ref
}

return (
<>
Expand Down
5 changes: 3 additions & 2 deletions packages/styled/src/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ let createStyled /*: CreateStyled */ = (
newProps[key] = props[key]
}
}

newProps.className = className
newProps.ref = ref
if (ref) {
newProps.ref = ref
}

return (
<>
Expand Down
Loading

0 comments on commit 7b6928e

Please sign in to comment.