You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const appendString = (children) => {
if (Array.isArray(children)) {
return children.reduce((acc, current) => {
if (typeof current === 'string') {
return acc.concat(current);
} else if (typeof current === 'object') {
return acc.concat(current.props.children);
} else {
return acc;
}
}, '');
} else {
return children + ''; // <-- Fix
}
};
It doesn't necessarily return a string type all the time, so have to force string.
The text was updated successfully, but these errors were encountered:
const appendString = (children) => {
if (Array.isArray(children)) {
return children.reduce((acc, current) => {
if (typeof current === 'string') {
return acc.concat(current);
} else if (typeof current === 'object') {
return acc.concat(current.props.children);
} else {
return acc;
}
}, '');
} else {
return children + ''; // <-- Fix
}
};
It doesn't necessarily return a string type all the time, so have to force string.
The text was updated successfully, but these errors were encountered: