-
Notifications
You must be signed in to change notification settings - Fork 734
Infra/color slider group remove unsafe #944
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
Conversation
// static getDerivedStateFromProps(nextProps, prevState) { | ||
// if (nextProps.color !== Colors.getHexString(prevState.value)) { | ||
// return {value: Colors.getHSL(nextProps.color)}; | ||
// } | ||
// return null; | ||
// } | ||
|
||
UNSAFE_componentWillReceiveProps(nextProps) { | ||
if (nextProps.color !== Colors.getHexString(this.state.value)) { | ||
return {value: Colors.getHSL(nextProps.color)}; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't it break functionality?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not when I checked it. Did you have an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.
But If I understand correctly..
It supported initializing the color value when passing a different value to the prop. No?
Actually, I think it's better when removed....
merging.
Description
GradientSlider, ColorSliderGroup, SliderGroup - removing UNSAFE method.
Changelog
SliderGroup, GradientSlider, ColorSliderGroup - removing UNSAFE method.