native-datepicker
Advanced tools
Comparing version 1.1.0 to 1.1.1
# Changelog | ||
## 1.1.1 | ||
Fixed: | ||
- Fixed an issue where React-component would initialize the datepicker twice | ||
## 1.1.0 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "native-datepicker", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"main": "src/index.js", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/codeclown/native-datepicker", |
@@ -81,2 +81,19 @@ # native-datepicker | ||
##### `options.initialValue` | ||
type: `string` default: `""` | ||
Set the initial date input value. | ||
These are equivalent: | ||
```js | ||
const datepicker = new NativeDatepicker({ | ||
initialValue: '2020-11-09 12:43:00', | ||
}); | ||
// or | ||
const datepicker = new NativeDatepicker(); | ||
datepicker.setValue('2020-11-09 12:43:00'); | ||
``` | ||
##### `options.existingElement` | ||
@@ -83,0 +100,0 @@ |
@@ -13,3 +13,3 @@ const { createElement: h, useRef, useEffect, useState } = require('react'); | ||
useEffect(() => { | ||
if (spanRef.current) { | ||
if (spanRef.current && !datepicker) { | ||
const picker = new NativeDatepickerClass({ | ||
@@ -22,3 +22,3 @@ existingElement: spanRef.current, | ||
} | ||
}, [spanRef.current]); | ||
}, [spanRef.current, datepicker]); | ||
useEffect(() => { | ||
@@ -25,0 +25,0 @@ if (datepicker) { |
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
13615
228