Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Render custom component above thumb

Aperta
#605 0 commenti 1 reazione 1 assegnatario Vedi su GitHub

@BartoszKlonowski ci sta già lavorando.

Dal 10/9/2024.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

question

Ask your Question

i have requirement to render custom component with dynamic value above the thumb like this

image

I took a look at the code and there is no way for now to render custom component/element above the thumb.

maybe we can do something like this?

export const SliderTrackMark = ({
  isTrue,
  thumbImage,
  StepMarker,
+ index
+ renderAboveThumbComponent
}: TrackMarksProps) => {
  return (
    <View style={styles.trackMarkContainer}>
      {StepMarker ? <StepMarker stepMarked={isTrue} /> : null}
      {thumbImage && isTrue ? (
        <>
+           {renderAboveThumbComponent(index)}
            <View style={styles.thumbImageContainer}>
              <Image source={thumbImage} style={styles.thumbImage} />
            </View>
        </>
      ) : null}
    </View>
  );
};

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.
image

is it gonna be a conflict if we implement this?
or is there a better way to handle this case?

Lingua principale
TypeScript
Stelle
1.4k
Fork
295
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di callstack/react-native-slider

Tutte le issue di callstack/react-native-slider

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.