import { RenderableProps } from "preact" ; export function getOnlyChildAndChildren ( props ) { const children = props . children as JSX . Element [ ] ; const child = children . length === 1 ? children [ 0 ] : null ; return { child , children } ; }