Skip to content

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

Merged
merged 9 commits into from
Sep 29, 2020

Conversation

Inbal-Tish
Copy link
Collaborator

Description

GradientSlider, ColorSliderGroup, SliderGroup - removing UNSAFE method.

Changelog

SliderGroup, GradientSlider, ColorSliderGroup - removing UNSAFE method.

Comment on lines -24 to -36
// 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)};
}
}

Copy link
Collaborator

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?

Copy link
Collaborator Author

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?

Copy link
Collaborator

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.

@ethanshar ethanshar merged commit 24d21db into master Sep 29, 2020
@Inbal-Tish Inbal-Tish deleted the infra/ColorSliderGroup_remove_UNSAFE branch September 29, 2020 18:24
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.

2 participants