UNPKG

@itwin/core-react

Version:

A react component library of iTwin.js UI general purpose components

23 lines 840 B
/*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ /** @packageDocumentation * @module Utilities */ import * as React from "react"; /** Flattens React fragments. * @internal */ export const flattenChildren = (children) => { const items = React.Children.map(children, (child) => { if (!React.isValidElement(child)) return child; if (child.type === React.Fragment) { return child.props.children; } return child; }); return items; }; //# sourceMappingURL=flattenChildren.js.map