From 93c3a1aa594491eaba440f29599127817e308ca8 Mon Sep 17 00:00:00 2001 From: Addin Gama Bertaqwa Date: Thu, 13 Jul 2023 08:25:35 +0800 Subject: [PATCH] feat: Add testID prop and use it for modal handle testID prefix --- package.json | 2 +- src/index.tsx | 5 ++++- src/options.ts | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2d7a11c6..d02ea59b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-modalize", - "version": "2.1.1", + "version": "2.1.2", "description": "A highly customizable modal/bottom sheet that loves scrolling content.", "main": "lib/index.js", "types": "./lib/index.d.ts", diff --git a/src/index.tsx b/src/index.tsx index 68586a5e..ef2b1dda 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -57,6 +57,9 @@ const PAN_DURATION = 150; const ModalizeBase = ( { + // Test + testID, + // Refs contentRef, @@ -671,7 +674,7 @@ const ModalizeBase = ( onHandlerStateChange={handleComponent} > - + ); diff --git a/src/options.ts b/src/options.ts index d9a4d964..a815ad64 100644 --- a/src/options.ts +++ b/src/options.ts @@ -42,6 +42,10 @@ export interface IConfigProps { } export interface IProps { + /** + * The testID prefix for all child component + */ + testID?: string; /** * A reference to the view (ScrollView, FlatList, SectionList) that provides the scroll behavior, where you will be able to access their owns methods. */