Skip to content

Commit a932a66

Browse files
committed
Fix Invariant Violation: onlyChild must be passed a children with exactly one child.
1 parent 13078eb commit a932a66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/linkClass.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ linkClass = (element, styles = {}, userConfiguration) => {
5353
if (typeof element.props.children !== 'string') {
5454
childrenCount = React.Children.count(element.props.children);
5555

56-
if (childrenCount > 1) {
56+
if (childrenCount > 1 || Array.isArray(element.props.children)) {
5757
newChildren = React.Children.map(element.props.children, (node) => {
5858
if (React.isValidElement(node)) {
5959
return linkClass(node, styles, configuration);

0 commit comments

Comments
 (0)