UNPKG

shineout

Version:

Shein 前端组件库

21 lines (17 loc) 614 B
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose"; import React, { Children, cloneElement } from 'react'; function Group(props) { var children = props.children, style = props.style, inputFocus = props.inputFocus, other = _objectWithoutPropertiesLoose(props, ["children", "style", "inputFocus"]); return Children.toArray(children).map(function (child, i) { if (typeof child === 'string') { return React.createElement("span", { key: i }, child); } return cloneElement(child, other); }); } export default Group;