diff --git a/test/Test.jsx b/test/Test.tsx
similarity index 96%
rename from test/Test.jsx
rename to test/Test.tsx
index 8b5c101..550b3e9 100644
--- a/test/Test.jsx
+++ b/test/Test.tsx
@@ -18,12 +18,14 @@ const errorConfig = {
children: 'Try again',
};
-function sleep(ms) {
+function sleep(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
export default function Test() {
- function onSyncClick() {}
+ function onSyncClick() {
+ // Intentionally empty
+ }
async function onAsyncClick() {
await sleep(2000);
diff --git a/test/button.styles.js b/test/button.styles.ts
similarity index 100%
rename from test/button.styles.js
rename to test/button.styles.ts
diff --git a/test/index.jsx b/test/index.tsx
similarity index 68%
rename from test/index.jsx
rename to test/index.tsx
index cb2b506..4a67864 100644
--- a/test/index.jsx
+++ b/test/index.tsx
@@ -3,7 +3,7 @@ import { createRoot } from 'react-dom/client';
import Test from './Test';
-createRoot(document.getElementById('react-root')).render(
+createRoot(document.getElementById('react-root') as HTMLDivElement).render(
,
diff --git a/test/package.json b/test/package.json
index bc00cbd..6cc6afe 100644
--- a/test/package.json
+++ b/test/package.json
@@ -26,6 +26,7 @@
"@babel/preset-react": "^7.14.0",
"@babel/preset-typescript": "^7.18.6",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.0",
+ "@types/styled-components": "^5.1.26",
"babel-loader": "^9.0.0",
"css-loader": "^6.0.0",
"eslint": "^8.26.0",
@@ -33,6 +34,7 @@
"mini-css-extract-plugin": "^2.0.0",
"react-refresh": "^0.14.0",
"style-loader": "^3.0.0",
+ "typescript": "^4.9.4",
"webpack": "^5.20.0",
"webpack-cli": "^5.0.0",
"webpack-dev-server": "^4.0.0"
diff --git a/test/webpack.config.js b/test/webpack.config.js
index d4ea1fa..be55675 100644
--- a/test/webpack.config.js
+++ b/test/webpack.config.js
@@ -12,7 +12,7 @@ module.exports = {
bail: isProduction,
context: path.join(__dirname),
entry: {
- src: './index.jsx',
+ src: './index.tsx',
},
output: {
path: path.resolve(__dirname, 'dist'),
diff --git a/test/yarn.lock b/test/yarn.lock
index 526d172..879db0c 100644
--- a/test/yarn.lock
+++ b/test/yarn.lock
@@ -1711,6 +1711,16 @@ __metadata:
languageName: node
linkType: hard
+"@types/hoist-non-react-statics@npm:*":
+ version: 3.3.1
+ resolution: "@types/hoist-non-react-statics@npm:3.3.1"
+ dependencies:
+ "@types/react": "*"
+ hoist-non-react-statics: ^3.3.0
+ checksum: 2c0778570d9a01d05afabc781b32163f28409bb98f7245c38d5eaf082416fdb73034003f5825eb5e21313044e8d2d9e1f3fe2831e345d3d1b1d20bcd12270719
+ languageName: node
+ linkType: hard
+
"@types/html-minifier-terser@npm:^6.0.0":
version: 6.1.0
resolution: "@types/html-minifier-terser@npm:6.1.0"
@@ -1822,6 +1832,17 @@ __metadata:
languageName: node
linkType: hard
+"@types/styled-components@npm:^5.1.26":
+ version: 5.1.26
+ resolution: "@types/styled-components@npm:5.1.26"
+ dependencies:
+ "@types/hoist-non-react-statics": "*"
+ "@types/react": "*"
+ csstype: ^3.0.2
+ checksum: 84f53b3101739b20d1731554fb7735bc2f3f5d050a8b392e9845403c8c8bbd729737d033978649f9195a97b557875b010d46e35a4538564a2d0dbcce661dbf76
+ languageName: node
+ linkType: hard
+
"@types/ws@npm:^8.5.1":
version: 8.5.4
resolution: "@types/ws@npm:8.5.4"
@@ -3761,7 +3782,7 @@ __metadata:
languageName: node
linkType: hard
-"hoist-non-react-statics@npm:^3.0.0":
+"hoist-non-react-statics@npm:^3.0.0, hoist-non-react-statics@npm:^3.3.0":
version: 3.3.2
resolution: "hoist-non-react-statics@npm:3.3.2"
dependencies:
@@ -5236,6 +5257,7 @@ __metadata:
"@babel/preset-react": ^7.14.0
"@babel/preset-typescript": ^7.18.6
"@pmmmwh/react-refresh-webpack-plugin": ^0.5.0
+ "@types/styled-components": ^5.1.26
"@wojtekmaj/react-async-button": "portal:../"
babel-loader: ^9.0.0
css-loader: ^6.0.0
@@ -5249,6 +5271,7 @@ __metadata:
react-refresh: ^0.14.0
style-loader: ^3.0.0
styled-components: ^5.3.0
+ typescript: ^4.9.4
webpack: ^5.20.0
webpack-cli: ^5.0.0
webpack-dev-server: ^4.0.0
@@ -6124,6 +6147,26 @@ __metadata:
languageName: node
linkType: hard
+"typescript@npm:^4.9.4":
+ version: 4.9.4
+ resolution: "typescript@npm:4.9.4"
+ bin:
+ tsc: bin/tsc
+ tsserver: bin/tsserver
+ checksum: e782fb9e0031cb258a80000f6c13530288c6d63f1177ed43f770533fdc15740d271554cdae86701c1dd2c83b082cea808b07e97fd68b38a172a83dbf9e0d0ef9
+ languageName: node
+ linkType: hard
+
+"typescript@patch:typescript@^4.9.4#~builtin":
+ version: 4.9.4
+ resolution: "typescript@patch:typescript@npm%3A4.9.4#~builtin::version=4.9.4&hash=ddd1e8"
+ bin:
+ tsc: bin/tsc
+ tsserver: bin/tsserver
+ checksum: 37f6e2c3c5e2aa5934b85b0fddbf32eeac8b1bacf3a5b51d01946936d03f5377fe86255d4e5a4ae628fd0cd553386355ad362c57f13b4635064400f3e8e05b9d
+ languageName: node
+ linkType: hard
+
"unicode-canonical-property-names-ecmascript@npm:^2.0.0":
version: 2.0.0
resolution: "unicode-canonical-property-names-ecmascript@npm:2.0.0"