\n
\n \n \n \n {Children.map(children, (child) => {\n if (!React.isValidElement) {\n return null;\n }\n\n const {\n type: { displayName },\n } = child;\n\n const childProps = {\n ModalHeader: { ...child.props, id: titleId },\n ModalBody: {\n ...child.props,\n className: wrenchModalBody,\n id: bodyId,\n handleClick,\n ref: modalBodyRef,\n },\n }[displayName] || {\n ...child.props,\n };\n\n return React.cloneElement(child, { ...childProps });\n })}\n
\n