Closed Mbompr closed 8 years ago
Have you tried to wrap your custom marker to pass props to it?
const CustomMarker = props => {
const { markerStyle, pressed, pressedMarkerStyle, text } = props;
return (
<View style={[ markerStyle, pressed && pressedMarkerStyle ]}>
{text && <Text>{text}</Text>}
</View>
);
}
// ...
<Slider values={[1]} min={0} max={10} customMarker={props =>
<CustomMarker {...props} text="Custom Marker" />
}
/>
// ...
Edit: Feel free to reopen if this doesn't serve your needs
It worked like a charm, thanks!
My customMarker is a React component and I needed to pass props to it. Hence, I added a new prop customProps to do it.