summaryrefslogtreecommitdiff
path: root/src/hooks
diff options
context:
space:
mode:
authorHaishan <[email protected]>2022-06-06 23:39:56 +0800
committerHaishan <[email protected]>2022-06-06 23:39:56 +0800
commit78f3434cb52f53c66936de278f0828c19ef63666 (patch)
treee7f9685cc0f3d8eaa6a94ad330e8876752ecb276 /src/hooks
parent23e734aa548354bb7ceff5ad8d85de95cd860a55 (diff)
Run prettier
Diffstat (limited to 'src/hooks')
-rw-r--r--src/hooks/useRemainingViewPortHeight.ts7
-rw-r--r--src/hooks/useTextInput.ts4
2 files changed, 5 insertions, 6 deletions
diff --git a/src/hooks/useRemainingViewPortHeight.ts b/src/hooks/useRemainingViewPortHeight.ts
index 9f3470d..2c920c2 100644
--- a/src/hooks/useRemainingViewPortHeight.ts
+++ b/src/hooks/useRemainingViewPortHeight.ts
@@ -9,9 +9,10 @@ const { useState, useRef, useCallback, useLayoutEffect } = React;
* to the bottom of the view port
*
*/
-export default function useRemainingViewPortHeight<
- ElementType extends HTMLDivElement
->(): [React.MutableRefObject<ElementType>, number] {
+export default function useRemainingViewPortHeight<ElementType extends HTMLDivElement>(): [
+ React.MutableRefObject<ElementType>,
+ number
+] {
const ref = useRef<ElementType>(null);
const [containerHeight, setContainerHeight] = useState(200);
const updateContainerHeight = useCallback(() => {
diff --git a/src/hooks/useTextInput.ts b/src/hooks/useTextInput.ts
index 1fa19f7..853044c 100644
--- a/src/hooks/useTextInput.ts
+++ b/src/hooks/useTextInput.ts
@@ -9,9 +9,7 @@ export function useTextInut(
): [(e: React.ChangeEvent<HTMLInputElement>) => void, string] {
const [, setTextGlobal] = useRecoilState(x);
const [text, setText] = useState('');
- const setTextDebounced = useMemo(() => debounce(setTextGlobal, 300), [
- setTextGlobal,
- ]);
+ const setTextDebounced = useMemo(() => debounce(setTextGlobal, 300), [setTextGlobal]);
const onChange = useCallback(
(e: React.ChangeEvent<HTMLInputElement>) => {
setText(e.target.value);