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

react-curry

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-curry - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

4

package.json
{
"name": "react-curry",
"version": "1.0.7",
"description": "react stateless curry",
"version": "1.0.8",
"description": "react stateless component curry",
"main": "./lib/index.js",

@@ -6,0 +6,0 @@ "scripts": {

@@ -5,3 +5,3 @@ inspired by curry in functional programming

because react component always contains only one parameter which is props, my curry
function's work is to deep merge two props.
function's work is to deep merge props.

@@ -13,7 +13,12 @@ ## how to install

## use case
## demo
let us make an Original component
```
```
when you want write some similar components.
<img style="width: 100px" src="./water.png"/>
<img style="width: 100px" src="./google.png"/>

@@ -59,2 +64,10 @@ these component show green border when selected

});
React.render(
<div>
<TextGreenBox selected={true} innerProps={{text: '西瓜'}}/>
<ImgGreenBox selected={true} innerProps={{imgSrc: 'https://www.google.com.hk/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'}}/>
</div>,
document.getElementById('root')
)
```

@@ -61,0 +74,0 @@

import React from 'react';
import {merge} from 'lodash';
import { merge } from 'lodash';
export default (Component, obj) => (
(props) => <Component {...merge(obj, props)}/>
);
export default (ComponentOrElementName, preProps) => {
const merged = { ...merge(preProps, props) };
return (typeof ComponentOrElementName === 'string')
? (props) => React.createElement(ComponentOrElementName, merged)
: (props) => <Component {...merged} />
};
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