From ac8b983a3d8f768cf8e81025058677d9d917c101 Mon Sep 17 00:00:00 2001 From: Alan Chambers Date: Thu, 14 Sep 2023 09:54:54 +0100 Subject: [PATCH] updated react wrapper - updated @lit-labs/react to latest version with improved type compatibility - added small preact section to the react docs with link to preact/compat typescript config guide --- docs/pages/frameworks/react.md | 4 ++++ package-lock.json | 14 +++++++------- package.json | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/pages/frameworks/react.md b/docs/pages/frameworks/react.md index 86f208efea..b87cb9c700 100644 --- a/docs/pages/frameworks/react.md +++ b/docs/pages/frameworks/react.md @@ -32,6 +32,10 @@ If you'd rather not use the CDN for assets, you can create a [build task](https: Now you can start using components! +### Preact + +Preact users facing type errors using components may benefit from setting "paths" in their tsconfig.json so that react types will instead resolve to preact/compat as described in [Preact's typescript documentation](https://preactjs.com/guide/v10/typescript/#typescript-preactcompat-configuration). + ## Usage ### Importing Components diff --git a/package-lock.json b/package-lock.json index 44151bdb5b..f5355740dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@ctrl/tinycolor": "^4.0.1", "@floating-ui/dom": "^1.2.1", - "@lit-labs/react": "^2.0.1", + "@lit-labs/react": "^2.0.3", "@shoelace-style/animations": "^1.1.0", "@shoelace-style/localize": "^3.1.1", "composed-offset-position": "^0.0.4", @@ -1474,9 +1474,9 @@ } }, "node_modules/@lit-labs/react": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@lit-labs/react/-/react-2.0.1.tgz", - "integrity": "sha512-Nj+XB3HamqaWefN91lpFPJaqjJ78XzGkPWCedB4jyH22GBFEenpE9A/h8B/2dnIGXtNtd9D/RFpUdQ/dBtWFqA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@lit-labs/react/-/react-2.0.3.tgz", + "integrity": "sha512-lSvWbTrbxWqYv/iiOwbAEJfFZrKjO/QjJ4IEXhg43sdD5fNFz4wRXpVsntfVn4DnxpQd+NVRnrsF2USgK0XCTw==", "peerDependencies": { "@types/react": "17 || 18" } @@ -18290,9 +18290,9 @@ } }, "@lit-labs/react": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@lit-labs/react/-/react-2.0.1.tgz", - "integrity": "sha512-Nj+XB3HamqaWefN91lpFPJaqjJ78XzGkPWCedB4jyH22GBFEenpE9A/h8B/2dnIGXtNtd9D/RFpUdQ/dBtWFqA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@lit-labs/react/-/react-2.0.3.tgz", + "integrity": "sha512-lSvWbTrbxWqYv/iiOwbAEJfFZrKjO/QjJ4IEXhg43sdD5fNFz4wRXpVsntfVn4DnxpQd+NVRnrsF2USgK0XCTw==", "requires": {} }, "@lit-labs/ssr-dom-shim": { diff --git a/package.json b/package.json index a13591147b..a0de7626a1 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "dependencies": { "@ctrl/tinycolor": "^4.0.1", "@floating-ui/dom": "^1.2.1", - "@lit-labs/react": "^2.0.1", + "@lit-labs/react": "^2.0.3", "@shoelace-style/animations": "^1.1.0", "@shoelace-style/localize": "^3.1.1", "composed-offset-position": "^0.0.4",