-
Notifications
You must be signed in to change notification settings - Fork 734
ColorSliderGroup - refactor #3009
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
GradientSlider - change to useContext instead of asSliderGroupChild, fix typo and change useEffect to useDidUpdate.
…nto infra/ColorSliderGroup_refactor
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.
Looks good. Wrote couple of comments, also I noticed a weird bug, I'm not sure if it's a regression, but there's a small flicker when you drag of the sliders in the group
See attached video
https://github.com/wix/react-native-ui-lib/assets/1780255/5bf210f5-68c5-404f-b9f8-e418caf3c5dd
@@ -172,6 +157,5 @@ GradientSlider.displayName = 'GradientSlider'; | |||
GradientSlider.types = GradientSliderTypes; | |||
// @ts-expect-error | |||
export default asBaseComponent<GradientSliderProps, ComponentStatics<typeof GradientSlider>>( | |||
// @ts-expect-error | |||
forwardRef(asSliderGroupChild(forwardRef(GradientSlider))) | |||
forwardRef(forwardRef(GradientSlider)) |
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.
You have forwardRef twice
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.
Removed
@@ -172,6 +157,5 @@ GradientSlider.displayName = 'GradientSlider'; | |||
GradientSlider.types = GradientSliderTypes; | |||
// @ts-expect-error | |||
export default asBaseComponent<GradientSliderProps, ComponentStatics<typeof GradientSlider>>( |
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.
We can add another simplification
Replace asBaseComponent HOC with the useThemeProps
(see usages in View component)
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.
I got issues with the statics and the forwardRef so I decided to leave it
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.
That works for me or at least It didn't throw any errors...
export default forwardRef<GradientSliderProps<string | HSLA>, ComponentStatics<typeof GradientSlider>>(GradientSlider);
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.
Yep, I didn't move the forwardRef... I'll make the change
Fixed |
…nto infra/ColorSliderGroup_refactor
…nto infra/ColorSliderGroup_refactor
Check if ColorPicker works for you? |
I can move them... wired |
Description
ColorSliderGroup - refactor
Changelog
ColorSliderGroup - refactor
Additional info
ticket 4107