Skip to content

Commit

Permalink
fix: fix KeyName render props issue. fix #46
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Apr 5, 2024
1 parent 73412ef commit bfd10bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/section/KeyName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export const KeyNameComp = <T extends object>(props: PropsWithChildren<KeyNameCo
reset.style = { ...reset.style, ...style };
const Elm = as || 'span';
const child =
render && typeof render === 'function' && render({ ...reset, children }, { value, parentValue, keyName, keys });
render &&
typeof render === 'function' &&
render({ ...reset, children }, { value, parentValue, keyName, keys: keys || (keyName ? [keyName] : []) });
if (child) return child;
return <Elm {...reset}>{children}</Elm>;
};
Expand Down

0 comments on commit bfd10bc

Please sign in to comment.