Skip to content

Commit

Permalink
fix(phonebook): supported string and element as a child of phonebook
Browse files Browse the repository at this point in the history
  • Loading branch information
opensrc0 committed Feb 27, 2024
1 parent f13d710 commit f66d122
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions __app/component/PhoneBook/PhoneBook.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function PhoneBook({
}, []);

return isBrowser && (showForever || hasBrowserSupport()) ? (
React.Children.map(children, (child) => React.cloneElement(child, {
React.Children.map(children, (child) => React.cloneElement(typeof child === 'string' ? <span>{child}</span> : child, {
onClick: getContacts,
}))
) : null;
Expand All @@ -52,7 +52,7 @@ PhoneBook.propTypes = {
PhoneBook.defaultProps = {
cb: () => {},
contactProperty: ['name', 'email', 'tel', 'address', 'icon'],
isSelectMultiple: true,
isSelectMultiple: false,
showForever: false,
};

Expand Down

0 comments on commit f66d122

Please sign in to comment.