Skip to content

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

Merged
merged 16 commits into from
Jan 3, 2024
Merged

Moved GradientSlider to FC. #2834

merged 16 commits into from
Jan 3, 2024

Conversation

nitzanyiz
Copy link
Collaborator

@nitzanyiz nitzanyiz commented Nov 30, 2023

Description

Moved GradientSlider to a FC.

Changelog

GradientSlider - Moved to FC.

Additional info

None

@nitzanyiz nitzanyiz changed the title Moving the gradient slider component to fc. Moved GradientSlider to FC. Nov 30, 2023
@nitzanyiz nitzanyiz requested a review from ethanshar November 30, 2023 09:14
@nitzanyiz nitzanyiz marked this pull request as ready for review December 11, 2023 11:41
<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
Copy link
Collaborator

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
Copy link
Collaborator

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

@nitzanyiz nitzanyiz requested a review from ethanshar December 31, 2023 11:38
@ethanshar ethanshar merged commit 4e94a10 into master Jan 3, 2024
@nitzanyiz nitzanyiz deleted the toFC/GradientSlider branch January 17, 2024 14:26
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