From 64000fbb2ebf1486eb7f0466f90a48f9b64f44c1 Mon Sep 17 00:00:00 2001 From: kang Date: Tue, 14 May 2024 23:43:21 +0800 Subject: [PATCH] fix(treeselect): fix keys not pass pass through to default tree store (#2896) --- src/tree-select/TreeSelect.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/tree-select/TreeSelect.tsx b/src/tree-select/TreeSelect.tsx index d87d0c6660..4adef34d4f 100644 --- a/src/tree-select/TreeSelect.tsx +++ b/src/tree-select/TreeSelect.tsx @@ -92,7 +92,19 @@ const TreeSelect = forwardRef((originalProps [props.keys], ); - const { normalizeValue, formatValue, getNodeItem } = useTreeSelectUtils(props, treeRef); + const passThroughDefaultStore = useMemo( + () => ({ + data, + treeProps: { + keys: tKeys, + ...treeProps, + }, + valueType, + }), + [tKeys, data, treeProps, valueType], + ); + + const { normalizeValue, formatValue, getNodeItem } = useTreeSelectUtils(passThroughDefaultStore, treeRef); useImperativeHandle(ref, () => ({ ...(selectInputRef.current || {}),