Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-children-utilities

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-children-utilities

Recursive and extended utils for React children opaque data structure

  • 2.0.0-rc.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
66K
decreased by-2.63%
Maintainers
1
Weekly downloads
 
Created
Source

React Children Utilities

Gzip Bundle Size Build Status Test Coverage Status Known Vulnerabilities

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):

Fernando Pasik
Fernando Pasik

🐛 💻 📖 🤔
mrm007
mrm007

🐛 💻
yosef langer
yosef langer

🐛 💻
iyegoroff
iyegoroff

🐛 💻
Mark Allen
Mark Allen

🐛 💻
Ryosuke IWANAGA
Ryosuke IWANAGA

🐛 💻

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

License

MIT (c) 2018 Fernando Pasik

Keywords

FAQs

Package last updated on 03 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc