Comparing version 3.1.3 to 3.2.0
'use strict'; | ||
var deprecate = require('util-deprecate'); | ||
var classNames = require('classnames'); | ||
module.exports = deprecate(classNames, '`rcUtil.classSet()` is deprecated, use `classNames()` by `require(\'classnames\')` instead'); | ||
require('./warn')('`rcUtil classSet` is deprecated, use `classNames()` by `require(\'classnames\')` instead'); | ||
module.exports = classNames; |
'use strict'; | ||
require('./warn')('require(\'rc-util\') is deprecated, please require(\'rc-util/lib/xx\')'); | ||
module.exports = { | ||
@@ -4,0 +6,0 @@ guid: require('./guid'), |
'use strict'; | ||
var deprecate = require('util-deprecate'); | ||
var classNames = require('classnames'); | ||
module.exports = deprecate(classNames, '`rcUtil.joinClasses()` is deprecated, use `classNames()` by `require(\'classnames\')` instead'); | ||
require('./warn')('`rcUtil joinClasses()` is deprecated, use `classNames()` by `require(\'classnames\')` instead'); | ||
module.exports = classNames; |
'use strict'; | ||
var shallowEqual = require('shallowequal'); | ||
require('./warn')('`rcUtil PureRenderMixin` is deprecated, use `react-addons-pure-render-mixin` by `require(\'react-addons-pure-render-mixin\')` instead'); | ||
/** | ||
* If your React component's render function is "pure", e.g. it will render the | ||
* same result given the same props and state, provide this Mixin for a | ||
* considerable performance boost. | ||
* | ||
* Most React components have pure render functions. | ||
* | ||
* Example: | ||
* | ||
* const ReactComponentWithPureRenderMixin = | ||
* require('ReactComponentWithPureRenderMixin'); | ||
* React.createClass({ | ||
* mixins: [ReactComponentWithPureRenderMixin], | ||
* | ||
* render: function() { | ||
* return <div className={this.props.className}>foo</div>; | ||
* } | ||
* }); | ||
* | ||
* Note: This only checks shallow equality for props and state. If these contain | ||
* complex data structures this mixin may have false-negatives for deeper | ||
* differences. Only mixin to components which have simple props and state, or | ||
* use `forceUpdate()` when you know deep data structures have changed. | ||
*/ | ||
var ReactComponentWithPureRenderMixin = { | ||
shouldComponentUpdate: function shouldComponentUpdate(nextProps, nextState) { | ||
return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState); | ||
} | ||
}; | ||
module.exports = ReactComponentWithPureRenderMixin; | ||
module.exports = require('react-addons-pure-render-mixin'); |
{ | ||
"name": "rc-util", | ||
"version": "3.1.3", | ||
"version": "3.2.0", | ||
"description": "Common Utils For React Component", | ||
@@ -41,6 +41,6 @@ "keywords": [ | ||
"expect.js": "~0.3.1", | ||
"react": "^0.14.0", | ||
"react": "15.x", | ||
"rc-server": "3.x", | ||
"rc-tools": "4.x", | ||
"react-dom": "^0.14.0" | ||
"react-dom": "15.x" | ||
}, | ||
@@ -52,6 +52,6 @@ "pre-commit": [ | ||
"add-dom-event-listener": "1.x", | ||
"react-addons-pure-render-mixin": "15.x", | ||
"classnames": "2.x", | ||
"shallowequal": "0.2.x", | ||
"util-deprecate": "1.x" | ||
"shallowequal": "0.2.x" | ||
} | ||
} |
@@ -28,9 +28,3 @@ # rc-util | ||
## Usage | ||
```js | ||
import {shallowEqual} from 'rc-util'; | ||
console.log(shallowEqual({one: 1}, {one: 1})); | ||
``` | ||
## API | ||
@@ -63,6 +57,4 @@ | ||
## License | ||
rc-util is released under the MIT license. |
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
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
14159
17
0
609
59
+ Addedreact-addons-pure-render-mixin@15.6.3(transitive)
- Removedutil-deprecate@1.x
- Removedutil-deprecate@1.0.2(transitive)