diff --git a/package.json b/package.json index 85afdfa12b..57df440bf8 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ }, "homepage": "https://github.com/streamich/react-use#readme", "dependencies": { + "@types/react-wait": "^0.3.0", "copy-to-clipboard": "^3.1.0", "nano-css": "^5.1.0", "react-fast-compare": "^2.0.4", diff --git a/src/index.ts b/src/index.ts index dd3aac0859..07bee73325 100644 --- a/src/index.ts +++ b/src/index.ts @@ -74,7 +74,7 @@ import useUnmount from './useUnmount'; import useUpdate from './useUpdate'; import useUpdateEffect from './useUpdateEffect'; import useVideo from './useVideo'; -import useWait from './useWait'; +import { useWait, Waiter } from './useWait'; import useWindowScroll from './useWindowScroll'; import useWindowSize from './useWindowSize'; @@ -154,4 +154,5 @@ export { useWait, useWindowScroll, useWindowSize, + Waiter, }; diff --git a/src/useWait.ts b/src/useWait.ts index cacd6787b5..cb49802a36 100644 --- a/src/useWait.ts +++ b/src/useWait.ts @@ -1,5 +1,3 @@ import { useWait, Waiter } from 'react-wait'; -useWait.Waiter = Waiter; - -export default useWait; +export { useWait, Waiter }; diff --git a/yarn.lock b/yarn.lock index 306bf4c24d..7ae8875457 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2701,7 +2701,14 @@ resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.2.tgz#690a1475b84f2a884fd07cd797c00f5f31356ea8" integrity sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw== -"@types/react@16.8.23": +"@types/react-wait@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@types/react-wait/-/react-wait-0.3.0.tgz#6f7ef17571a17e72c7864ede8cf7d3aa525a005e" + integrity sha512-5jIfDcHRjqeE7QfZG7kCqOpfrPSvOM1E3/nlKuJ/NZrG/WrhLo/AFr0i72jhTWzyNRo4ex0pshBaiCHksZXH3A== + dependencies: + "@types/react" "*" + +"@types/react@*", "@types/react@16.8.23": version "16.8.23" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.8.23.tgz#ec6be3ceed6353a20948169b6cb4c97b65b97ad2" integrity sha512-abkEOIeljniUN9qB5onp++g0EY38h7atnDHxwKUFz1r3VH1+yG1OKi2sNPTyObL40goBmfKFpdii2lEzwLX1cA==