callstack / callstack/react-native-slider
Render custom component above thumb
- Lingua principale
- TypeScript
- Stelle
- 1.4k
- Fork
- 295
- Merge medio
- 5m
- PR unite (30g)
- 1
Descrizione
## Ask your Question
i have requirement to render custom component with dynamic value above the thumb like this

I took a look at the [code](https://github.com/callstack/react-native-slider/blob/main/package/src/components/TrackMark.tsx) and there is no way for now to render custom component/element above the thumb.
maybe we can do something like this?
```diff
export const SliderTrackMark = ({
isTrue,
thumbImage,
StepMarker,
+ index
+ renderAboveThumbComponent
}: TrackMarksProps) => {
return (
{StepMarker ? : null}
{thumbImage && isTrue ? (
<>
+ {renderAboveThumbComponent(index)}
) : null}
);
};
```
API name inspired by https://github.com/miblanchard/react-native-slider/blob/cb80d87c7f80f27856613e18459c80c70d638df7/README.md?plain=1#L88
maybe one consideration, from windows example
there is already a box with step value rendered above the thumb.

is it gonna be a conflict if we implement this?
or is there a better way to handle this case?
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.