Skip to content

Commit 8401a91

Browse files
authored
Declare customValue type for passing an arbitrary value to touchables (#890)
1 parent f117a34 commit 8401a91

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

generatedTypes/components/button/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ declare const _default: React.ComponentClass<(import("react-native").TouchableOp
337337
} | undefined;
338338
activeBackgroundColor?: string | undefined;
339339
useNative?: boolean | undefined;
340+
customValue?: any;
340341
ref?: any;
341342
} & import("../../commons/modifiers").CustomModifier & {
342343
/**
@@ -484,6 +485,7 @@ declare const _default: React.ComponentClass<(import("react-native").TouchableOp
484485
} | undefined;
485486
activeBackgroundColor?: string | undefined;
486487
useNative?: boolean | undefined;
488+
customValue?: any;
487489
ref?: any;
488490
} & import("../../commons/modifiers").CustomModifier & Partial<Record<"black" | "white" | "dark10" | "dark20" | "dark30" | "dark40" | "dark50" | "dark60" | "dark70" | "dark80" | "grey10" | "grey20" | "grey30" | "grey40" | "grey50" | "grey60" | "grey70" | "grey80" | "blue10" | "blue20" | "blue30" | "blue40" | "blue50" | "blue60" | "blue70" | "blue80" | "cyan10" | "cyan20" | "cyan30" | "cyan40" | "cyan50" | "cyan60" | "cyan70" | "cyan80" | "green10" | "green20" | "green30" | "green40" | "green50" | "green60" | "green70" | "green80" | "yellow10" | "yellow20" | "yellow30" | "yellow40" | "yellow50" | "yellow60" | "yellow70" | "yellow80" | "orange10" | "orange20" | "orange30" | "orange40" | "orange50" | "orange60" | "orange70" | "orange80" | "red10" | "red20" | "red30" | "red40" | "red50" | "red60" | "red70" | "red80" | "purple10" | "purple20" | "purple30" | "purple40" | "purple50" | "purple60" | "purple70" | "purple80" | "violet10" | "violet20" | "violet30" | "violet40" | "violet50" | "violet60" | "violet70" | "violet80", boolean>> & {
489491
/**
@@ -631,6 +633,7 @@ declare const _default: React.ComponentClass<(import("react-native").TouchableOp
631633
} | undefined;
632634
activeBackgroundColor?: string | undefined;
633635
useNative?: boolean | undefined;
636+
customValue?: any;
634637
ref?: any;
635638
} & Partial<Record<"text10" | "text20" | "text30" | "text40" | "text50" | "text60" | "text65" | "text70" | "text80" | "text90" | "text100" | "text10T" | "text10L" | "text10R" | "text10M" | "text10BO" | "text10H" | "text10BL" | "text20T" | "text20L" | "text20R" | "text20M" | "text20BO" | "text20H" | "text20BL" | "text30T" | "text30L" | "text30R" | "text30M" | "text30BO" | "text30H" | "text30BL" | "text40T" | "text40L" | "text40R" | "text40M" | "text40BO" | "text40H" | "text40BL" | "text50T" | "text50L" | "text50R" | "text50M" | "text50BO" | "text50H" | "text50BL" | "text60T" | "text60L" | "text60R" | "text60M" | "text60BO" | "text60H" | "text60BL" | "text65T" | "text65L" | "text65R" | "text65M" | "text65BO" | "text65H" | "text65BL" | "text70T" | "text70L" | "text70R" | "text70M" | "text70BO" | "text70H" | "text70BL" | "text80T" | "text80L" | "text80R" | "text80M" | "text80BO" | "text80H" | "text80BL" | "text90T" | "text90L" | "text90R" | "text90M" | "text90BO" | "text90H" | "text90BL" | "text100T" | "text100L" | "text100R" | "text100M" | "text100BO" | "text100H" | "text100BL", boolean>> & import("../../commons/modifiers").CustomModifier & {
636639
/**
@@ -778,6 +781,7 @@ declare const _default: React.ComponentClass<(import("react-native").TouchableOp
778781
} | undefined;
779782
activeBackgroundColor?: string | undefined;
780783
useNative?: boolean | undefined;
784+
customValue?: any;
781785
ref?: any;
782786
} & Partial<Record<"text10" | "text20" | "text30" | "text40" | "text50" | "text60" | "text65" | "text70" | "text80" | "text90" | "text100" | "text10T" | "text10L" | "text10R" | "text10M" | "text10BO" | "text10H" | "text10BL" | "text20T" | "text20L" | "text20R" | "text20M" | "text20BO" | "text20H" | "text20BL" | "text30T" | "text30L" | "text30R" | "text30M" | "text30BO" | "text30H" | "text30BL" | "text40T" | "text40L" | "text40R" | "text40M" | "text40BO" | "text40H" | "text40BL" | "text50T" | "text50L" | "text50R" | "text50M" | "text50BO" | "text50H" | "text50BL" | "text60T" | "text60L" | "text60R" | "text60M" | "text60BO" | "text60H" | "text60BL" | "text65T" | "text65L" | "text65R" | "text65M" | "text65BO" | "text65H" | "text65BL" | "text70T" | "text70L" | "text70R" | "text70M" | "text70BO" | "text70H" | "text70BL" | "text80T" | "text80L" | "text80R" | "text80M" | "text80BO" | "text80H" | "text80BL" | "text90T" | "text90L" | "text90R" | "text90M" | "text90BO" | "text90H" | "text90BL" | "text100T" | "text100L" | "text100R" | "text100M" | "text100BO" | "text100H" | "text100BL", boolean>> & Partial<Record<"black" | "white" | "dark10" | "dark20" | "dark30" | "dark40" | "dark50" | "dark60" | "dark70" | "dark80" | "grey10" | "grey20" | "grey30" | "grey40" | "grey50" | "grey60" | "grey70" | "grey80" | "blue10" | "blue20" | "blue30" | "blue40" | "blue50" | "blue60" | "blue70" | "blue80" | "cyan10" | "cyan20" | "cyan30" | "cyan40" | "cyan50" | "cyan60" | "cyan70" | "cyan80" | "green10" | "green20" | "green30" | "green40" | "green50" | "green60" | "green70" | "green80" | "yellow10" | "yellow20" | "yellow30" | "yellow40" | "yellow50" | "yellow60" | "yellow70" | "yellow80" | "orange10" | "orange20" | "orange30" | "orange40" | "orange50" | "orange60" | "orange70" | "orange80" | "red10" | "red20" | "red30" | "red40" | "red50" | "red60" | "red70" | "red80" | "purple10" | "purple20" | "purple30" | "purple40" | "purple50" | "purple60" | "purple70" | "purple80" | "violet10" | "violet20" | "violet30" | "violet40" | "violet50" | "violet60" | "violet70" | "violet80", boolean>> & {
783787
/**

generatedTypes/components/card/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ declare const _default: React.ComponentClass<ViewPropTypes & import("react-nativ
7070
} | undefined;
7171
activeBackgroundColor?: string | undefined;
7272
useNative?: boolean | undefined;
73+
customValue?: any;
7374
ref?: any;
7475
} & {
7576
/**

generatedTypes/components/touchableOpacity/index.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ export declare type TouchableOpacityProps = RNTouchableOpacityProps & ContainerM
2525
* Should use a more native touchable opacity component
2626
*/
2727
useNative?: boolean;
28+
/**
29+
* Custom value of any type to pass on to TouchableOpacity and receive back in onPress callback
30+
*/
31+
customValue?: any;
2832
ref?: any;
2933
};
3034
declare const _default: React.ComponentClass<RNTouchableOpacityProps & Partial<Record<import("../../commons/modifiers").AlignmentLiterals, boolean>> & Partial<Record<import("../../commons/modifiers").PositionLiterals, boolean>> & Partial<Record<"padding" | "paddingL" | "paddingT" | "paddingR" | "paddingB" | "paddingH" | "paddingV", boolean>> & Partial<Record<"margin" | "marginL" | "marginT" | "marginR" | "marginB" | "marginH" | "marginV", boolean>> & Partial<Record<"flex" | "flexG" | "flexS", boolean>> & Partial<Record<"br0" | "br10" | "br20" | "br30" | "br40" | "br50" | "br60" | "br100", boolean>> & Partial<Record<"bg", boolean>> & {
@@ -51,6 +55,10 @@ declare const _default: React.ComponentClass<RNTouchableOpacityProps & Partial<R
5155
* Should use a more native touchable opacity component
5256
*/
5357
useNative?: boolean | undefined;
58+
/**
59+
* Custom value of any type to pass on to TouchableOpacity and receive back in onPress callback
60+
*/
61+
customValue?: any;
5462
ref?: any;
5563
} & {
5664
useCustomTheme?: boolean | undefined;

src/components/touchableOpacity/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ export type TouchableOpacityProps = RNTouchableOpacityProps & ContainerModifiers
2626
* Should use a more native touchable opacity component
2727
*/
2828
useNative?: boolean;
29+
/**
30+
* Custom value of any type to pass on to TouchableOpacity and receive back in onPress callback
31+
*/
32+
customValue?: any;
2933
ref?: any;
3034
};
3135

0 commit comments

Comments
 (0)