Skip to content

Commit e1b696a

Browse files
committed
chore: remove react type compatibility shim
1 parent 98dcf63 commit e1b696a

4 files changed

Lines changed: 3 additions & 23 deletions

File tree

react-compat.d.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/OptionList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const OptionList: React.ForwardRefRenderFunction<ReviseRefOptionListProps> = (_,
7979
keyEntities,
8080
} = React.useContext(LegacyContext);
8181

82-
const treeRef = React.useRef<Tree>();
82+
const treeRef = React.useRef<Tree>(null);
8383

8484
const memoTreeData = useMemo(
8585
() => treeData,

src/hooks/useRefFunc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as React from 'react';
55
* but redirect to real function.
66
*/
77
export default function useRefFunc<T extends (...args: any[]) => any>(callback: T): T {
8-
const funcRef = React.useRef<T>();
8+
const funcRef = React.useRef<T>(callback);
99
funcRef.current = callback;
1010

1111
const cacheFn = React.useCallback((...args: any[]) => {

tsconfig.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,5 @@
2020
"strictBindCallApply": false,
2121
"module": "ESNext"
2222
},
23-
"include": [
24-
"react-compat.d.ts",
25-
"global.d.ts",
26-
".dumirc.ts",
27-
".fatherrc.ts",
28-
"src",
29-
"tests",
30-
"examples"
31-
]
23+
"include": ["global.d.ts", ".dumirc.ts", ".fatherrc.ts", "src", "tests", "examples"]
3224
}

0 commit comments

Comments
 (0)