Skip to content

Commit

Permalink
fix(DrawerList): prevent call attempt for word if not function (#3613)
Browse files Browse the repository at this point in the history
  • Loading branch information
joakbjerk authored May 28, 2024
1 parent cd4add9 commit 66e04ba
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,11 @@ export const parseContentTitle = (
if (preferSelectedValue) {
ret = String(
convertJsxToString(dataItem.selected_value, separator, (word) => {
const nestedChildren = !word.props.children && word?.type?.()
const nestedChildren =
!word.props.children &&
typeof word?.type === 'function' &&
word.type()

return nestedChildren?.props?.children ? nestedChildren : word
})
)
Expand Down

0 comments on commit 66e04ba

Please sign in to comment.