From 749ea000582021fb467cbe47be201363977b6e18 Mon Sep 17 00:00:00 2001 From: chenos Date: Tue, 9 Nov 2021 17:10:36 +0800 Subject: [PATCH] fix(client): TypeError: Cannot read properties of null (reading 'setSelectedRows') --- packages/client/src/schemas/select/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/schemas/select/index.tsx b/packages/client/src/schemas/select/index.tsx index 067f3a48fd..73c9ac8327 100644 --- a/packages/client/src/schemas/select/index.tsx +++ b/packages/client/src/schemas/select/index.tsx @@ -243,7 +243,7 @@ Select.Object = connect( const OptionTagContext = createContext(null); -const SelectedRowsContext = createContext(null); +const SelectedRowsContext = createContext({}); Select.useOkAction = () => { const { props } = useContext(SelectContext); @@ -266,7 +266,7 @@ Select.useRowSelection = () => { Select.useSelect = () => { const { setSelectedRows } = useContext(SelectedRowsContext); return (keys, rows) => { - setSelectedRows(rows); + setSelectedRows && setSelectedRows(rows); console.log('Select.onSelect', keys, rows); }; };