react-flatpickr
Advanced tools
Comparing version 3.9.0 to 3.9.1
@@ -65,17 +65,20 @@ "use strict"; | ||
_createClass(DateTimePicker, [{ | ||
key: "componentWillReceiveProps", | ||
value: function componentWillReceiveProps(props) { | ||
key: "componentDidUpdate", | ||
value: function componentDidUpdate(prevProps) { | ||
var _this = this; | ||
var options = props.options; | ||
var prevOptions = this.props.options; // Add prop hooks to options | ||
if (this.props.hasOwnProperty('value') && this.props.value !== prevProps.value) { | ||
this.flatpickr.setDate(this.props.value, false); | ||
} | ||
var options = this.props.options; | ||
var prevOptions = prevProps.options; | ||
hooks.forEach(function (hook) { | ||
if (props.hasOwnProperty(hook)) { | ||
options[hook] = props[hook]; | ||
if (_this.props.hasOwnProperty(hook)) { | ||
options[hook] = _this.props[hook]; | ||
} // Add prev ones too so we can compare against them later | ||
if (_this.props.hasOwnProperty(hook)) { | ||
prevOptions[hook] = _this.props[hook]; | ||
if (prevProps.hasOwnProperty(hook)) { | ||
prevOptions[hook] = prevProps[hook]; | ||
} | ||
@@ -98,6 +101,2 @@ }); | ||
} | ||
if (props.hasOwnProperty('value') && props.value !== this.props.value) { | ||
this.flatpickr.setDate(props.value, false); | ||
} | ||
} | ||
@@ -104,0 +103,0 @@ }, { |
@@ -56,14 +56,17 @@ import React, { Component } from 'react' | ||
componentWillReceiveProps(props) { | ||
const { options } = props | ||
const prevOptions = this.props.options | ||
componentDidUpdate(prevProps) { | ||
if (this.props.hasOwnProperty('value') && this.props.value !== prevProps.value) { | ||
this.flatpickr.setDate(this.props.value, false) | ||
} | ||
// Add prop hooks to options | ||
const { options } = this.props | ||
const prevOptions = prevProps.options | ||
hooks.forEach(hook => { | ||
if (props.hasOwnProperty(hook)) { | ||
options[hook] = props[hook] | ||
if (this.props.hasOwnProperty(hook)) { | ||
options[hook] = this.props[hook] | ||
} | ||
// Add prev ones too so we can compare against them later | ||
if (this.props.hasOwnProperty(hook)) { | ||
prevOptions[hook] = this.props[hook] | ||
if (prevProps.hasOwnProperty(hook)) { | ||
prevOptions[hook] = prevProps[hook] | ||
} | ||
@@ -73,3 +76,2 @@ }) | ||
const optionsKeys = Object.getOwnPropertyNames(options) | ||
for (let index = optionsKeys.length - 1; index >= 0; index--) { | ||
@@ -89,5 +91,2 @@ const key = optionsKeys[index] | ||
if (props.hasOwnProperty('value') && props.value !== this.props.value) { | ||
this.flatpickr.setDate(props.value, false) | ||
} | ||
} | ||
@@ -94,0 +93,0 @@ |
{ | ||
"name": "react-flatpickr", | ||
"version": "3.9.0", | ||
"version": "3.9.1", | ||
"description": "flatpickr for React", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
1
17785
4
285
1