react-native-slider icon indicating copy to clipboard operation
react-native-slider copied to clipboard

Feature: please export SliderProps

Open hirbod opened this issue 2 years ago • 6 comments

I want to type my component but I am not able to since SliderProps are not exported. The community slider package does export it though (I migrated to yours which was definitely the best decision)

Bildschirmfoto 2022-04-25 um 10 17 19

hirbod avatar Apr 25 '22 08:04 hirbod

This package does export the types which have been generated automatically https://github.com/miblanchard/react-native-slider/blob/main/package.json#L6

Compared to the community package: https://github.com/callstack/react-native-slider/blob/main/src/package.json#L12

hirbod avatar Apr 25 '22 08:04 hirbod

@hirbod are you saying the types definition in my package.json is incorrect, or SliderProps needs an additional export beyond that?

miblanchard avatar Jul 03 '22 18:07 miblanchard

It's been a while, but irc the export was missing

hirbod avatar Jul 03 '22 18:07 hirbod

Oh yeah, just read the error message in the screenshot

hirbod avatar Jul 03 '22 18:07 hirbod

Bump! Would also love this.

Jacknes avatar Jul 21 '22 22:07 Jacknes

For the time being, you can work around this problem with:

type SliderProps = Parameters<NonNullable<Slider['shouldComponentUpdate']>>[0];

konne88 avatar Aug 30 '22 14:08 konne88

bump, it'll be of great value to the consumers of this package!

jiwtir avatar Feb 03 '23 02:02 jiwtir

SliderProps can now be imported as of version 2.3.0 import { SliderProps } from '@miblanchard/react-native-slider/lib/types';

emilfjellstrom avatar Mar 06 '23 12:03 emilfjellstrom