(
children: React.ReactNode,
props: P
)
| 6 | * @param props Parent props |
| 7 | */ |
| 8 | export function cloneReactChildren<P>( |
| 9 | children: React.ReactNode, |
| 10 | props: P |
| 11 | ): React.ReactNode { |
| 12 | return Children.map(children, (child) => { |
| 13 | if (isValidElement(child)) { |
| 14 | return cloneElement(child, props); |
| 15 | } |
| 16 | return child; |
| 17 | }); |
| 18 | } |
no outgoing calls
no test coverage detected