callstack / react-native-slider

React Native component exposing Slider from iOS and SeekBar from Android
MIT License
1.22k stars 270 forks source link

added `value` prop to `StepMarker` component prop #598

Closed biw closed 2 months ago

biw commented 6 months ago

Summary:

Hello, thanks for the work on the library, it's great! I added a value prop to the recently added StepMarker prop. This allows developers to render StepMarker conditionally based on their value. This is a small change with a low service area but enables developers to implement features present in other slider libraries (sometimes called marks)

My other solution, which would be larger, was making the StepNumber component something that could be passed in. Happy to update my PR in that direction if that would be helpful!

Test Plan:

This is a small change, doesn't change any external APIs, and passes all npm tests. I have tested it in a web and native app but thought I'd put together a PR to share the changes upstream. Let me know how I can be more helpful on this front!