Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moment.js mutability issue (+validation) #57

Open
Enieste opened this issue Apr 5, 2017 · 0 comments
Open

Moment.js mutability issue (+validation) #57

Enieste opened this issue Apr 5, 2017 · 0 comments
Labels

Comments

@Enieste
Copy link

Enieste commented Apr 5, 2017

Hello! I'm trying to add a validation to the component, conditionally setting state in the onChange callback. It seems it doesn't work really well due moment.js object mutability.

See the screencast attached and the commit Enieste@14e04be (the time of screencast create is around 6:10 PM)

One way to handle this is passing moment={moment(this.state.m)} (i.e. clone of an object) but the component will still remain partially buggy (you can check yourself, moving the slider towards the right quick enough).

Not that the bug can be reproduced if you move the slider quick enough. You'll have a different output depending on slider movement speed.

Screencast: https://www.youtube.com/watch?v=FbqMIWDJMrk

Hope it makes sense.

@wangzuo wangzuo added the bug label Sep 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants