Skip to content

Commit

Permalink
React 19 support (#81) fix(80)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiaslins authored Oct 25, 2024
1 parent 7fa98c6 commit 926b277
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vercel/speed-insights",
"version": "1.0.13",
"version": "1.0.14",
"description": "Speed Insights is a tool for measuring web performance and providing suggestions for improvement.",
"keywords": [
"speed-insights",
Expand Down Expand Up @@ -112,7 +112,7 @@
"peerDependencies": {
"@sveltejs/kit": "^1 || ^2",
"next": ">= 13",
"react": "^18 || ^19",
"react": "^18 || ^19 || ^19.0.0-rc",
"svelte": ">= 4",
"vue": "^3",
"vue-router": "^4"
Expand Down
5 changes: 3 additions & 2 deletions packages/web/src/nextjs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ function SpeedInsightsComponent(props: Props): React.ReactElement {
return <SpeedInsightsScript route={route} {...props} framework="next" />;
}

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

0 comments on commit 926b277

Please sign in to comment.