react-curry
Advanced tools
Comparing version 1.1.5 to 1.1.6
@@ -7,4 +7,2 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _react = require('react'); | ||
@@ -14,3 +12,3 @@ | ||
var _lodash = require('lodash'); | ||
var _ramda = require('ramda'); | ||
@@ -20,9 +18,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = function (ComponentOrElementName, preProps) { | ||
var merged = _extends({}, (0, _lodash.merge)(preProps, props)); | ||
return typeof ComponentOrElementName === 'string' ? function (props) { | ||
return _react2.default.createElement(ComponentOrElementName, merged); | ||
return _react2.default.createElement(ComponentOrElementName, (0, _ramda.mergeDeepLeft)(preProps, props)); | ||
} : function (props) { | ||
return _react2.default.createElement(Component, merged); | ||
return _react2.default.createElement(ComponentOrElementName, (0, _ramda.mergeDeepLeft)(preProps, props)); | ||
}; | ||
}; |
{ | ||
"name": "react-curry", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "react stateless component curry", | ||
@@ -21,3 +21,3 @@ "main": "./lib2/index.js", | ||
"dependencies": { | ||
"lodash": "*", | ||
"ramda": "^0.24.1", | ||
"react": ">=14.0.0" | ||
@@ -24,0 +24,0 @@ }, |
import React from 'react'; | ||
import { merge } from 'lodash'; | ||
import { mergeDeepLeft } from 'ramda'; | ||
export default (ComponentOrElementName, preProps) => { | ||
return (typeof ComponentOrElementName === 'string') | ||
? (props) => React.createElement(ComponentOrElementName, merge(preProps, props)) | ||
: (props) => <ComponentOrElementName {...merge(preProps, props)} /> | ||
}; | ||
export default (ComponentOrElementName, preProps) => | ||
(typeof ComponentOrElementName === 'string') | ||
? (props) => React.createElement(ComponentOrElementName, mergeDeepLeft(preProps, props)) | ||
: (props) => <ComponentOrElementName {...mergeDeepLeft(preProps, props)} /> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
1
44060
35
+ Addedramda@^0.24.1
+ Addedramda@0.24.1(transitive)
- Removedlodash@*
- Removedlodash@4.17.21(transitive)