Closed niklasnatter closed 2 years ago
Same here 😞
I think that this problem was introduced in version 3.1.0, which was released a few days ago. I have created a pull request to fix the issue here https://github.com/arqex/react-datetime/pull/803
If you run into this problem in your project, you can use the following version constraint in your package.json
as a workaround. The workaround will prevent npm from installing the newly released version that contains the problem.
"react-datetime": ">=3.0.0 <3.1.0 || ^3.1.1"
Thanks, I hope it gets merged and published soon. Shame tests don't cover this.
Sorry about it guys! It should be fixed in v3.1.1 that has just been released.
The cause was a half baked refactor that got into the master branch as part of the last version. @johnhunter is right, I should add this case to the tests soon.
Dont worry - thanks for the fast release, we are really appreciating this! 🙂 Hope you are having a good day!
I'm Submitting a ...
Steps to Reproduce
<Datetime />
with thevalue
propvalue
prop to something that does not match the expected date formatExpected Results
The error should be logged to the console, but the component should not crash hard.
Actual Results
An error is thrown and the component crashes hard.
Minimal Reproduction of the Problem
Runnable example on stackblitz.com
Other Information (e.g. stacktraces, related issues, suggestions how to fix)
The
setViewDate
method accesses alog
function that does not exist anymore. Thelog
function was moved outside the class in https://github.com/arqex/react-datetime/commit/d4450038cd901f1e0f31bcd365448820f60c6f67#diff-cae892f0886b91915576f17fd54c818f7ef44b721a3885d4a742039f1c8cad03L557-R611. https://github.com/arqex/react-datetime/blob/4e880f2167789867d6074a655c18c16717a92e49/src/DateTime.js#L534-L537Stacktrace