Skip to content

Commit 68a9de1

Browse files
Fix: Type error when using Slider with props as ref (#369)
* Introduce SliderReferenceType * Use SliderReferenceType for ref type
1 parent 4099689 commit 68a9de1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/typings/index.d.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import * as React from "react";
22
import * as ReactNative from "react-native";
33

4+
type SliderReferenceType = (
5+
React.MutableRefObject<SliderRef> &
6+
React.LegacyRef<Slider>
7+
) | undefined;
8+
49
export interface SliderPropsAndroid extends ReactNative.ViewProps {
510
/**
611
* Color of the foreground switch grip.
@@ -145,7 +150,7 @@ export interface SliderProps extends SliderPropsIOS, SliderPropsAndroid, SliderP
145150
/**
146151
* Reference object.
147152
*/
148-
ref?: React.MutableRefObject<SliderRef>;
153+
ref?: SliderReferenceType;
149154
}
150155

151156
/**

0 commit comments

Comments
 (0)