From 72d007a7c68f3528accda9190a5b73b007249a2a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:02:36 +0800 Subject: [PATCH] type: React.Key => SafeKey (#578) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: afc163 --- .husky/pre-commit | 1 + examples/form.tsx | 19 +++-------- package.json | 39 +++++++++++---------- src/LegacyContext.tsx | 18 +++++----- src/OptionList.tsx | 14 ++++---- src/TreeNode.tsx | 4 +-- src/TreeSelect.tsx | 66 +++++++++++++++--------------------- src/hooks/useCache.ts | 6 ++-- src/hooks/useCheckedKeys.ts | 11 +++--- src/hooks/useDataEntities.ts | 5 +-- src/interface.ts | 43 ++++++++++++----------- src/utils/legacyUtil.tsx | 8 ++--- src/utils/strategyUtil.ts | 31 ++++++----------- src/utils/valueUtil.ts | 5 ++- 14 files changed, 123 insertions(+), 147 deletions(-) create mode 100644 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..af5adff9 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +lint-staged \ No newline at end of file diff --git a/examples/form.tsx b/examples/form.tsx index 0ab0ebd7..17464cd5 100644 --- a/examples/form.tsx +++ b/examples/form.tsx @@ -21,7 +21,7 @@ const errorStyle = { }; class TreeSelectInput extends Component<{ - onChange?: Function; + onChange?: (value: string[]) => void; style: React.CSSProperties; }> { onChange = (value, ...args) => { @@ -105,11 +105,7 @@ const Demo = () => { > {(control, { errors }) => (
- +

{errors.join(',')}

@@ -122,18 +118,11 @@ const Demo = () => {
{(control, { errors }) => (
-