-
Notifications
You must be signed in to change notification settings - Fork 734
Moved GradientSlider to FC. #2834
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
<View marginB-s3 row> | ||
<Text marginR-s2>Custom Color</Text> | ||
<Switch value={customColor} onValueChange={setCustomColor}/> | ||
</View> | ||
<GradientSlider type={GradientSlider.types.HUE} color={color as string} onValueChange={setColor}/> | ||
{ | ||
// @ts-ignore |
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 shouldn't ignore TS here, you have a justified TS error.
Notice that the typing your declare for GradientSlider includes sliderContext
, but this is actually an internal prop you are passing... internally.
So the right way to approach this is to not include this type (sliderContext) in GradientSlider props.
Instead, you can expect the sliderContext
prop only in the component's code. Like this..
type Props = GradientSliderComponentProps & ForwardRefInjectedProps & {sliderContext: SliderContextProps};
const GradientSlider = (props: Props) => {.....
onValueChange={this.onGradientValueChange} | ||
/> | ||
{ | ||
// @ts-ignore |
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.
Same here, see if my comment above fix this issue
49f8bff
to
035333c
Compare
d76f317
to
4f948b5
Compare
Description
Moved GradientSlider to a FC.
Changelog
GradientSlider - Moved to FC.
Additional info
None