Skip to content

Commit 926b277

Browse files
authored
React 19 support (#81) fix(80)
1 parent 7fa98c6 commit 926b277

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/web/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vercel/speed-insights",
3-
"version": "1.0.13",
3+
"version": "1.0.14",
44
"description": "Speed Insights is a tool for measuring web performance and providing suggestions for improvement.",
55
"keywords": [
66
"speed-insights",
@@ -112,7 +112,7 @@
112112
"peerDependencies": {
113113
"@sveltejs/kit": "^1 || ^2",
114114
"next": ">= 13",
115-
"react": "^18 || ^19",
115+
"react": "^18 || ^19 || ^19.0.0-rc",
116116
"svelte": ">= 4",
117117
"vue": "^3",
118118
"vue-router": "^4"

packages/web/src/nextjs/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ function SpeedInsightsComponent(props: Props): React.ReactElement {
1111
return <SpeedInsightsScript route={route} {...props} framework="next" />;
1212
}
1313

14-
export function SpeedInsights(props: Props): React.ReactElement {
14+
export function SpeedInsights(props: Props): null {
15+
// Because of incompatible types between ReactNode in React 19 and React 18 we return null (which is also what we render)
1516
return (
1617
<Suspense fallback={null}>
1718
<SpeedInsightsComponent {...props} />
1819
</Suspense>
19-
);
20+
) as never;
2021
}

0 commit comments

Comments
 (0)