# All files / extensions childrenWithProps.js

0% Statements 0/10
0% Branches 0/4
0% Functions 0/3
0% Lines 0/4

    1
    2
    3
    4
    5
    6
    7
    8

     import React from 'react';
    import { omit } from 'lodash';

    export default (props, extraProps) =>
      React.Children.map(props.children, child =>
        React.cloneElement(child, { ...omit(props, 'children'), ...extraProps }),
      );