@instructure/ui-react-utils
Version:
A React utility library made by Instructure Inc.
19 lines • 687 B
TypeScript
import { ReactNode } from 'react';
/**
* ---
* category: utilities/react
* ---
*
* Ensure a single child. If it is a child of length 1, return a
* cloned instance of the child. If it is a child of length > 1,
* wrap in a span and return the child. Return null if child has
* no length.
* @module ensureSingleChild
* @param child
* @param props props for child
* @returns cloned instance for a single child, or children wrapped in a span
*/
declare function ensureSingleChild(child: ReactNode, props?: {}): import("@emotion/react/jsx-runtime").JSX.Element | null;
export default ensureSingleChild;
export { ensureSingleChild };
//# sourceMappingURL=ensureSingleChild.d.ts.map