Popularity
2.1
-
Activity
8.6
Growing
123
5
13

Monthly Downloads: 0
Programming language: JavaScript
License: MIT License
Tags: Utilities     React     Reactjs     Children     Utils    

react-children-utilities alternatives and similar libraries

Based on the "Utilities" category

Do you think we are missing an alternative of react-children-utilities or a related project?

Add another 'Utilities' Library

README

React Children Utilities

Gzip Bundle Size Build Status Test Coverage Status Known Vulnerabilities

All Contributors npm version npm downloads

Recursive and extended utils for React children opaque data structure.

Installation

Available as a package and can be added to your application with npm or yarn after installing the peer dependency react

# with yarn
yarn add react-children-utilities react

# with npm
npm install --save react-children-utilities

Usage

This package extends the existing React.Children utilities, you can import it as a whole.

import React from 'react';
import Children from 'react-children-utilities';

const MyComponent = ({ children }) => {
  const onlySpans = Children.filter(children, (child) => child.type === 'span');
  return <div>{onlySpans}</div>;
};

Also you can import only the function you need

import React from 'react';
import { filter } from 'react-children-utilities';

const MyComponent = ({ children }) => {
  const onlySpans = filter(children, (child) => child.type === 'span');
  return <div>{onlySpans}</div>;
};

API documentation

Contributors ✨

Thanks goes to these wonderful people (emoji key):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore-start --> <!-- markdownlint-disable --> Fernando Pasik🐛 💻 📖 🤔 mrm007🐛 💻 yosef langer🐛 💻 iyegoroff🐛 💻 Mark Allen🐛 💻 Ryosuke IWANAGA🐛 💻 Daniel Pinyol🐛 💻 Brian Bartholomew🐛 💻

<!-- markdownlint-enable --> <!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT (c) 2018 Fernando Pasik


*Note that all licence references and agreements mentioned in the react-children-utilities README section above are relevant to that project's source code only.