UNPKG

@gluestack-ui/utils

Version:
11 lines (10 loc) 465 B
import React from 'react'; export const wrapStringChild = (children, StyledBoxText) => { return React.Children.map(children, (child) => { return typeof child === 'string' || typeof child === 'number' || (child?.type === React.Fragment && (typeof child.props?.children === 'string' || typeof child.props?.children === 'number')) ? (<StyledBoxText>{child}</StyledBoxText>) : (child); }); };