🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-flatpickr

Package Overview
Dependencies
Maintainers
2
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-flatpickr - npm Package Compare versions

Comparing version

to
3.9.1

23

build/index.js

@@ -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",