Skip to content

Commit

Permalink
fixed react 19 errors (#690)
Browse files Browse the repository at this point in the history
* fixed react 19 errors

* add changeset

* remove previous changeset

* fix typo
  • Loading branch information
rezrah authored Sep 2, 2024
1 parent aff5874 commit 98fa3a2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/late-badgers-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react-brand': minor
---

Improved React 19 compatibility by treating `react-dom/client` and `react/jsx-runtime` as external dependencies of the project. This change resolved a reported conflict with the latest React 19 release candidate.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
"webpack-cli": "^4.10.0"
},
"peerDependencies": {
"react": ">=17 <= 18",
"react-dom": ">=17 <= 18"
"react": ">=17 <20",
"react-dom": ">=17 <20"
},
"engines": {
"node": ">=16.0.0",
Expand Down
14 changes: 14 additions & 0 deletions packages/react/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,25 @@ module.exports = {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react',
},
'react-dom': {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom',
},
'react-dom/client': {
root: 'ReactDOMClient',
commonjs2: 'react-dom/client',
commonjs: 'react-dom/client',
amd: 'react-dom/client',
},
'react/jsx-runtime': {
root: 'ReactJSXRuntime',
commonjs2: 'react/jsx-runtime',
commonjs: 'react/jsx-runtime',
amd: 'react/jsx-runtime',
},
},
mode: 'production',
Expand Down

0 comments on commit 98fa3a2

Please sign in to comment.