Popularity
2.8
Growing
Activity
8.9
Growing
180
5
14

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

react-children-utilities alternatives and similar libraries

Based on the "Utilities" category.
Alternatively, view react-children-utilities alternatives based on common mentions on social networks and blogs.

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

Add another 'Utilities' Library

README

React Children Utilities

Recursive and extended utils for React children opaque data structure.

<!-- BADGES - START -->

Gzip Bundle Size Build Status Coverage Status Known Vulnerabilities

All Contributors npm version npm downloads

<!-- BADGES - END -->

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-restore --> <!-- prettier-ignore-end -->

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

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

License

MIT (c) 2016 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.