react-curry
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -1,11 +0,1 @@ | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
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'); | ||
var _react2 = _interopRequireDefault(_react); | ||
@@ -17,10 +7,12 @@ | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
exports.default = function (ComponentOrElementName, preProps) { | ||
var merged = _extends({}, (0, _lodash.merge)(preProps, props)); | ||
var merged = {}; | ||
return typeof ComponentOrElementName === 'string' ? function (props) { | ||
return _react2.default.createElement(ComponentOrElementName, merged); | ||
return _react2.default.createElement.apply(_react2.default, [ComponentOrElementName].concat(_toConsumableArray((0, _lodash.merge)(preProps, props)))); | ||
} : function (props) { | ||
return _react2.default.createElement(Component, merged); | ||
return _react2.default.createElement(Component, (0, _lodash.merge)(preProps, props)); | ||
}; | ||
}; |
{ | ||
"name": "react-curry", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "react stateless component curry", | ||
@@ -5,0 +5,0 @@ "main": "./lib2/index.js", |
@@ -5,7 +5,7 @@ import React from 'react'; | ||
export default (ComponentOrElementName, preProps) => { | ||
const merged = { ...merge(preProps, props) }; | ||
const merged = { }; | ||
return (typeof ComponentOrElementName === 'string') | ||
? (props) => React.createElement(ComponentOrElementName, merged) | ||
: (props) => <Component {...merged} /> | ||
? (props) => React.createElement(ComponentOrElementName, ...merge(preProps, props)) | ||
: (props) => <Component {...merge(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
44651
9
35