Skip to content

Commit

Permalink
feat: React 19 support
Browse files Browse the repository at this point in the history
  • Loading branch information
imjordanxd committed Feb 7, 2025
1 parent 67006f0 commit 1e38d55
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 81 deletions.
2 changes: 1 addition & 1 deletion lib/makeWebpackConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = async (playroomConfig, options) => {
}
);
const { version } = JSON.parse(pkgContents);
isLegacyReact = !(version.startsWith('18') || version.startsWith('0.0.0'));
isLegacyReact = !(version.startsWith('18') || version.startsWith('19') || version.startsWith('0.0.0'));
} catch (e) {
throw new Error('Unable to read `react-dom` package json');
}
Expand Down
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
"@types/base64-url": "^2.2.0",
"@types/codemirror": "^5.60.5",
"@types/prettier": "^2.7.1",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@types/react": "19.0.8",
"@types/react-dom": "19.0.3",
"@vanilla-extract/css": "^1.9.2",
"@vanilla-extract/css-utils": "^0.1.3",
"@vanilla-extract/dynamic": "^2.1.2",
Expand Down Expand Up @@ -132,21 +132,26 @@
"husky": "^8.0.2",
"jest": "^29.3.1",
"lint-staged": "^15.2.2",
"react": "^18.0.1",
"react-dom": "^18.0.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"serve": "^14.1.2",
"start-server-and-test": "^1.15.2",
"surge": "^0.23.1"
},
"peerDependencies": {
"react": "^17 || ^18",
"react-dom": "^17 || ^18"
"react": "^17 || ^18 || ^19",
"react-dom": "^17 || ^18 || ^19"
},
"engines": {
"node": ">=18.12.0"
},
"packageManager": "[email protected]",
"volta": {
"node": "18.19.1"
},
"pnpm": {
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
}
}
}
21 changes: 21 additions & 0 deletions patches/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 9b28df0e8aa4734af2c7006fd077ff17e2281db5..0000000000000000000000000000000000000000
diff --git a/esm/useIntersection.d.ts b/esm/useIntersection.d.ts
index 9d3ac04942d2f3118e5fb5bf3c1758e4513d1fa5..62d128868aa774d80674896a3ce532a6125526aa 100644
--- a/esm/useIntersection.d.ts
+++ b/esm/useIntersection.d.ts
@@ -1,3 +1,3 @@
import { RefObject } from 'react';
-declare const useIntersection: (ref: RefObject<HTMLElement>, options: IntersectionObserverInit) => IntersectionObserverEntry | null;
+declare const useIntersection: (ref: RefObject<HTMLElement | null>, options: IntersectionObserverInit) => IntersectionObserverEntry | null;
export default useIntersection;
diff --git a/lib/useIntersection.d.ts b/lib/useIntersection.d.ts
index 9d3ac04942d2f3118e5fb5bf3c1758e4513d1fa5..62d128868aa774d80674896a3ce532a6125526aa 100644
--- a/lib/useIntersection.d.ts
+++ b/lib/useIntersection.d.ts
@@ -1,3 +1,3 @@
import { RefObject } from 'react';
-declare const useIntersection: (ref: RefObject<HTMLElement>, options: IntersectionObserverInit) => IntersectionObserverEntry | null;
+declare const useIntersection: (ref: RefObject<HTMLElement | null>, options: IntersectionObserverInit) => IntersectionObserverEntry | null;
export default useIntersection;
125 changes: 60 additions & 65 deletions pnpm-lock.yaml

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

Loading

0 comments on commit 1e38d55

Please sign in to comment.