Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update to React 19 #393

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion development/client/components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, {type JSX} from "react";

import {Context, classNames} from "@reactivated";
import {Helmet} from "react-helmet-async";
Expand Down
56 changes: 24 additions & 32 deletions package-lock.json

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

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
"sample",
"website",
"development"
]
],
"overrides": {
"react": "^19.0.0"
}
Comment on lines +10 to +13
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed since react-helmet-async doesn't officially support React 19 yet. But it seems to work fine. I'm a little concerned that it's a dead project, but I'll probably submit a MR to it anyway.

See staylor/react-helmet-async#239

}
8 changes: 4 additions & 4 deletions packages/reactivated/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"@types/eslint__js": "^8.42.3",
"@types/eslint-config-prettier": "^6.11.3",
"@types/express": "^5.0.0",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"@vanilla-extract/css": "^1.16.0",
"@vanilla-extract/css-utils": "^0.1.4",
"@vanilla-extract/dynamic": "^2.1.2",
Expand All @@ -57,8 +57,8 @@
"jiti": "^2.4.1",
"json-schema-to-typescript": "^15.0.2",
"prettier": "^3.3.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-helmet-async": "^2.0.5",
"terser": "^5.36.0",
"ts-morph": "^24.0.0",
Expand Down
9 changes: 7 additions & 2 deletions packages/reactivated/src/client.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {hydrateRoot} from "react-dom/client";
import React from "react";
import {hydrate} from "react-dom";

const props = (window as any).__PRELOADED_STATE__;

Expand All @@ -11,5 +11,10 @@ if ((module as any).hot) {
const Template = require("client/templates/" + props.template_name + ".tsx").default;

export const bootstrap = () => {
hydrate(<Template {...props} />, document.getElementById("root"));
const root = document.getElementById("root");
if (!root) {
console.error("div#root is missing!");
return;
}
hydrateRoot(root, <Template {...props} />);
};
4 changes: 2 additions & 2 deletions packages/reactivated/src/render.mts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Request} from "express";
import {HelmetProvider, HelmetServerState} from "react-helmet-async";
import * as React from "react";
import * as ReactDOMServer from "react-dom/server";
import React, {type JSX} from "react";
import ReactDOMServer from "react-dom/server";

// @ts-ignore
import {Provider} from "@reactivated";
Expand Down
2 changes: 1 addition & 1 deletion website/client/forms.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, {type JSX} from "react";

import {FieldHandler, Widget} from "@reactivated";

Expand Down
2 changes: 1 addition & 1 deletion website/client/templates/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, {type JSX} from "react";

import {templates} from "@reactivated";
import {Helmet} from "react-helmet-async";
Expand Down
Loading