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

Update slider range when passing new props #10

Merged
merged 2 commits into from
Apr 9, 2019

Conversation

alexmasnou
Copy link
Contributor

No description provided.

src/index.js Outdated
return (
!isEqual(nextProps.start, start) ||
nextProps.disabled !== disabled ||
nextProps.range !== range
Copy link
Owner

@mmarkelov mmarkelov Apr 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

range is object, so it will be always true - and this is not what I actually want.
You can use isEqual from utils, but you should also make some changes to support objects

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mmarkelov, sorry for the mistake. I fixed it in the last commit. I used a simple function to compare objects. Maybe in the future it will be interesting to use a more robust method like _.isEqual from lodash.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexmasnou I should think about it. I don't want to include this kind of dependencies and want to make library as simple as possible

@mmarkelov
Copy link
Owner

@alexmasnou Thank you! I'll release new version soon

@mmarkelov mmarkelov merged commit b263aa2 into mmarkelov:master Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants