React-datetime version 3.0.4 not control value setState with null, undefined and invalid date
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 858
- PR merge metrics
- No merged PRs in 30d
Description
### I'm Submitting a ...
```
[x] Bug report
[ ] Feature request
[ ] Support request
```
### Steps to Reproduce
1. Fill in/initialize the value in the field from a state
2. Replace the value in the state with null/undefined/invalid date
### Expected Results
The value has changed
### Actual Results
The value has not changed
### Minimal Reproduction of the Problem
Reproducible example: https://codesandbox.io/s/objective-neumann-ctgb0?file=/src/App.js
### Other Information (e.g. stacktraces, related issues, suggestions how to fix)
Version 2.16.3 of react-datetime doesn't have this problem.
Contributor guide
Research direction
Start with the linked CodeSandbox reproduction and confirm the behavior using react-datetime 3.0.4 with state values set to null, undefined, and an invalid date. Compare the result with version 2.16.3 and trace the component's controlled-value handling. Done means the displayed value changes when the state is replaced with each reported value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100