Utilities for manipulating children components
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.babelrc
.babelrc.js
.gitignore
.npmignore
LICENSE
README.md
package.json
yarn.lock

README.md

idyll-component-children

Utilities for manipulating children components

Usage

const { filterChildren, mapChildren } = require('idyll-component-children');

filterChildren(children, (c) => {
  // Filter for components named 'mycomponent'
  return c.type.name && c.type.name.toLowerCase() === 'mycomponent';
})


mapChildren(children, (c) => {
  // .. do some modification to the child
  return c;
})