New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-itertools

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-itertools - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

2

package.json
{
"name": "react-itertools",
"version": "0.0.2",
"version": "0.0.3",
"description": "A suite of tools for manipulating React children",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -34,2 +34,52 @@ # React Itertools

## Example
[Try the CodeSandbox Example!](https://codesandbox.io/s/flamboyant-nightingale-yvirv?file=/src/App.js)
```jsx
import { map } from "react-itertools";
import { isValidElement } from "react";
const MapExample = ({ children }) => {
const fn = (el) => {
return (
<div
style={{
border: "1px solid black",
padding: "10px",
backgroundColor: "blanchedalmond",
}}
>
{isValidElement(el) && el.props.children}
</div>
);
};
return <>{map(children, fn)}</>;
};
export default function App() {
return (
<>
<p>
`map` recursively iterates through all `children` and returns the
transformed result of applying `fn` to each child.
</p>
<p>Recurses depth first, post-order.</p>
<MapExample>
<div>
<div>
<div />
<div />
</div>
<div>
<div />
<div />
</div>
</div>
</MapExample>
</>
);
}
```
## Highlights

@@ -50,1 +100,5 @@

See the project's [MIT License](https://github.com/tatethurston/react-itertools/blob/master/LICENSE).
```
```
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