Skip to content

Commit b467127

Browse files
committed
Reapply "Use preact instead of react"
This reverts commit ec4a665.
1 parent 78d51a3 commit b467127

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

src/js/bun.lockb

-1.46 KB
Binary file not shown.

src/js/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"check": "prettier --check . && eslint"
66
},
77
"devDependencies": {
8-
"@types/react": "^18.2.48",
9-
"@types/react-dom": "^18.2.18",
108
"eslint": "^9.13.0",
119
"eslint-plugin-react": "^7.37.1",
1210
"prettier": "^3.3.3"
@@ -15,6 +13,7 @@
1513
"@pyscript/core": "^0.6",
1614
"@reactpy/client": "^0.3.2",
1715
"event-to-object": "^0.1.2",
18-
"morphdom": "^2.7.4"
16+
"morphdom": "^2.7.4",
17+
"preact": "^10.25.4"
1918
}
2019
}

src/js/src/components.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { DjangoFormProps, HttpRequestProps } from "./types";
2-
import React from "react";
3-
import ReactDOM from "react-dom";
2+
import React from "preact/compat";
3+
import ReactDOM from "preact/compat";
44
/**
55
* Interface used to bind a ReactPy node to React.
66
*/

src/js/src/mount.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { ReactPyDjangoClient } from "./client";
2-
import React from "react";
3-
import ReactDOM from "react-dom";
2+
import ReactDOM from "preact/compat";
43
import { Layout } from "@reactpy/client/src/components";
54

65
export function mountComponent(

src/js/tsconfig.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"esModuleInterop": true,
4+
"jsx": "react-jsx",
5+
"jsxImportSource": "preact",
6+
"target": "esnext",
7+
"module": "esnext",
8+
"moduleResolution": "node"
9+
}
10+
}

0 commit comments

Comments
 (0)