From 4f60016e3d90ef964eab99646d6f9cab2cb01c80 Mon Sep 17 00:00:00 2001 From: edelgarat <edelgarat@yandex.ru> Date: Tue, 2 Apr 2024 15:05:52 +0300 Subject: [PATCH] update build --- package-lock.json | 4 ++-- package.json | 2 +- src/global.d.ts | 5 ----- src/hooks/files/useFileSelector.ts | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) delete mode 100644 src/global.d.ts diff --git a/package-lock.json b/package-lock.json index b0b8b88..ebcefd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@worksolutions/react-utils", - "version": "2.2.3", + "version": "2.2.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@worksolutions/react-utils", - "version": "2.2.3", + "version": "2.2.4", "dependencies": { "@popperjs/core": "^2.*", "@worksolutions/utils": "^1.4.3", diff --git a/package.json b/package.json index 1e6a1f7..1fec9d1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@worksolutions/react-utils", "private": false, - "version": "2.2.3", + "version": "2.2.4", "description": "", "types": "dist/esm/index.d.ts", "main": "dist/cjs/index.js", diff --git a/src/global.d.ts b/src/global.d.ts deleted file mode 100644 index 53d688f..0000000 --- a/src/global.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare namespace NodeJS { - interface Process { - browser: boolean; - } -} diff --git a/src/hooks/files/useFileSelector.ts b/src/hooks/files/useFileSelector.ts index 374a920..e0732ef 100644 --- a/src/hooks/files/useFileSelector.ts +++ b/src/hooks/files/useFileSelector.ts @@ -24,7 +24,7 @@ export function useFileSelector( [multiply, onChange], ); const input = React.useMemo( - () => (process.browser ? createFileInput(handleChange, multiply, acceptTypes) : null), + () => (typeof window === "undefined" ? null : createFileInput(handleChange, multiply, acceptTypes)), [multiply, handleChange, acceptTypes], ); const [dropAreaProps, dropAreaState] = useDropArea({ onFiles: handleChange });