From da21d741d959a6e24100915fd53f4d503531178b Mon Sep 17 00:00:00 2001 From: Jesse Katsumata Date: Wed, 23 Oct 2024 10:40:29 +0900 Subject: [PATCH 1/2] fix: lint error --- js/SegmentedControl.js | 4 +++- js/types.js | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/js/SegmentedControl.js b/js/SegmentedControl.js index 85a2934..cbbf69e 100644 --- a/js/SegmentedControl.js +++ b/js/SegmentedControl.js @@ -114,7 +114,9 @@ const SegmentedControl = ({ return ( index ? testIDS[index] : `${index}`} + testID={ + (testIDS?.length ?? 0) > index ? testIDS[index] : `${index}` + } selected={selectedIndex === index} accessibilityHint={`${ index + 1 diff --git a/js/types.js b/js/types.js index 34cecd6..24254e6 100644 --- a/js/types.js +++ b/js/types.js @@ -108,7 +108,6 @@ export type SegmentedControlProps = $ReadOnly<{| */ tabStyle?: ViewStyle, - /** * array testID to each segment button */ From 62236b3be843fc9879d012ca56fc85c60d41c5c7 Mon Sep 17 00:00:00 2001 From: Jesse Katsumata Date: Wed, 23 Oct 2024 10:41:19 +0900 Subject: [PATCH 2/2] fix: flow error --- js/types.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/types.js b/js/types.js index 24254e6..4c96c1e 100644 --- a/js/types.js +++ b/js/types.js @@ -111,5 +111,5 @@ export type SegmentedControlProps = $ReadOnly<{| /** * array testID to each segment button */ - testIDS: $ReadOnlyArray, + testIDS: $ReadOnlyArray, |}>;