fernandopasik / React Children Utilities
Licence: mit
Extended utils for ⚛️ React.Children data structure that adds recursive filter, map and more methods to iterate nested children.
Stars: ✭ 154
Programming Languages
typescript
32286 projects
Projects that are alternatives of or similar to React Children Utilities
Utils
A collection of useful PHP functions, mini classes and snippets that you need and can use every day.
Stars: ✭ 750 (+387.01%)
Mutual labels: utils, utility-library
go-tools
A utility tool library of Golang.
Stars: ✭ 44 (-71.43%)
Mutual labels: utils, utility-library
Bbo
bbo is a utility library of zero dependencies for javascript. 🍖🌭🍔
Stars: ✭ 227 (+47.4%)
Mutual labels: utils, utility-library
Sassyfication
💅Library with sass mixins to speed up your css workflow.
Stars: ✭ 51 (-66.88%)
Mutual labels: utils, utility-library
Notils
Never again need a .utils. package yur scurvy sea dogs!
Stars: ✭ 126 (-18.18%)
Mutual labels: utility-library
Counter culture
Turbo-charged counter caches for your Rails app.
Stars: ✭ 1,397 (+807.14%)
Mutual labels: utility-library
Ramda Extension
🤘Utility library for functional JavaScript. With ❤️ to Ramda.
Stars: ✭ 139 (-9.74%)
Mutual labels: utils
Bash Utils
Miscellaneous small utils, mainly for the Bash shell.
Stars: ✭ 121 (-21.43%)
Mutual labels: utils
Smartbreadcrumbs
A utility library for ASP.NET Core (both MVC and Razor Pages) websites to easily add and customize breadcrumbs.
Stars: ✭ 113 (-26.62%)
Mutual labels: utility-library
Ppo
ppo is a super small and useful utils library for JavaScript 🐝🐜
Stars: ✭ 105 (-31.82%)
Mutual labels: utils
Touch Bar Istats
Show CPU/GPU/MEM temperature on Touch Bar with BetterTouchTool!
Stars: ✭ 141 (-8.44%)
Mutual labels: utils
Utils.js
Fast, small and purely functional utility library
Stars: ✭ 102 (-33.77%)
Mutual labels: utils
Utils.js
Useful JavaScript Functions Collection 一些很实用的JavaScript函数封装集合
Stars: ✭ 121 (-21.43%)
Mutual labels: utils
React Children Utilities
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
- deepFilter
- deepFind
- deepForEach
- deepMap
- filter
- groupByType
- hasChildren
- hasComplexChildren
- onlyText
- onlyValid
Contributors ✨
Thanks goes to these wonderful people (emoji key):
Fernando Pasik 🐛 💻 📖 🤔 |
mrm007 🐛 💻 |
yosef langer 🐛 💻 |
iyegoroff 🐛 💻 |
Mark Allen 🐛 💻 |
Ryosuke IWANAGA 🐛 💻 |
Daniel Pinyol 🐛 💻 |
Brian Bartholomew 🐛 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!
License
MIT (c) 2018 Fernando Pasik
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].