Coder Social home page Coder Social logo

ivoreis / react-children-utilities Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fernandopasik/react-children-utilities

0.0 1.0 0.0 908 KB

Extended utils for React.Children opaque data structure

License: MIT License

JavaScript 100.00%

react-children-utilities's Introduction

React Children Utilities

Gzip Bundle Size Build Status Test Coverage Status Known Vulnerabilities

npm version npm downloads peerDependency Status devDependency Status

Extended utils for React.Children opaque data structure.

Install

This is a peer dependency so react must be present

npm install --save react-children-utilities react

Usage

Instead of requiring Children from React, require this one, it will extend existing capabilities from Children in your current React version.

var Children = require('react-children-utilities');

With ES6 modules

import Children from 'react-children-utilities';

Api documentation

Children.filter

Creates a new children array with all elements that pass the test implemented by the provided function.

Children.filter(children, callback)

Children.groupByType

Returns an object with keys that map each tag name to an array of children of that type, and a key that maps the rest of children.

Children.groupByType(children, tagNames[, restKey])

Children.deepMap

Creates a new children array with the results of calling a provided function on every element (and its children) in the provided children.

Children.deepMap(children, callback)

Children.deepForEach

Executes a provided function on every element (and its children) in the provided children.

Children.deepForEach(children, callback)

Children.deepFind

Returns the first element in the children (and its children) that satisfies the provided testing function.

Children.deepFind(children, callback)

Children.onlyText

Strips all html and returns only text nodes

Children.onlyText(children)

License

MIT (c) 2018 Fernando Pasik

react-children-utilities's People

Contributors

fernandopasik avatar iyegoroff avatar mrm007 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.