Socket
Socket
Sign inDemoInstall

rc-rate

Package Overview
Dependencies
5
Maintainers
5
Versions
32
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.4.2 to 2.4.3

18

es/Rate.js

@@ -0,1 +1,3 @@

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; };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -11,2 +13,3 @@

import classNames from 'classnames';
import { polyfill } from 'react-lifecycles-compat';
import KeyCode from 'rc-util/es/KeyCode';

@@ -49,12 +52,9 @@ import { getOffsetLeft } from './util';

Rate.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if ('value' in nextProps) {
var value = nextProps.value;
if (value === undefined) {
value = nextProps.defaultValue;
}
this.setState({
value: value
Rate.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, state) {
if ('value' in nextProps && nextProps.value !== undefined) {
return _extends({}, state, {
value: nextProps.value
});
}
return state;
};

@@ -285,2 +285,4 @@

polyfill(Rate);
export default Rate;

@@ -5,2 +5,4 @@ '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');

@@ -22,2 +24,4 @@

var _reactLifecyclesCompat = require('react-lifecycles-compat');
var _KeyCode = require('rc-util/lib/KeyCode');

@@ -74,12 +78,9 @@

Rate.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if ('value' in nextProps) {
var value = nextProps.value;
if (value === undefined) {
value = nextProps.defaultValue;
}
this.setState({
value: value
Rate.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, state) {
if ('value' in nextProps && nextProps.value !== undefined) {
return _extends({}, state, {
value: nextProps.value
});
}
return state;
};

@@ -310,3 +311,5 @@

(0, _reactLifecyclesCompat.polyfill)(Rate);
exports['default'] = Rate;
module.exports = exports['default'];
{
"name": "rc-rate",
"version": "2.4.2",
"version": "2.4.3",
"description": "React Star Rate Component",

@@ -71,4 +71,5 @@ "keywords": [

"prop-types": "^15.5.8",
"rc-util": "^4.3.0"
"rc-util": "^4.3.0",
"react-lifecycles-compat": "^3.0.4"
}
}

@@ -127,2 +127,8 @@ # rc-rate

</tr>
<tr>
<td>disabled</td>
<td>bool</td>
<td>false</td>
<td></td>
</tr>
</tbody>

@@ -129,0 +135,0 @@ </table>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with āš”ļø by Socket Inc