How to use the react-children-utilities.deepMap function in react-children-utilities

To help you get started, we’ve selected a few react-children-utilities examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iyegoroff / react-native-image-filter-kit / src / common / create-image-filter.js View on Github external
acc[val] = convert(restProps[val]);

        return acc; 
      },
      {}
    )
  );

  let keepImage = true;

  return (
    
      {Children.deepMap(children, (child) => {
        if (isImage(child)) {
          if (keepImage) {
            keepImage = false;
            return child;

          } else {
            return React.cloneElement(
              child,
              { ...child.props, style: mapHiddenImageStyle(child.props.style) }
            );
          }

        } else {
          return child;
        }
      })}

react-children-utilities

Extended utils for ⚛️ React.Children data structure that adds recursive filter, map and more methods to iterate nested children.

MIT
Latest version published 10 months ago

Package Health Score

76 / 100
Full package analysis