react-native/RNTester/js
Ziqi Chen 1bc52267f5 accessibilityTraits + accessibilityComponentType >> accessibilityRole + accessibilityStates 3/3
Summary:
Previously, I created two props, `accessibilityRole` and `accessibilityStates` for view. These props were intended to be a cross-platform solution to replace  `accessibilityComponentType` on Android and `accessibilityTraits` on iOS.

In this stack, I ran a code mod to replace instances of the two old properties used in our codebase with the new ones.
For this diff, I did a search for the few remaining uses of `accessibilityTraits` that was not caught by my script or the previous diff in the stack, and I manually changed them to `accessibilityRole` and `accessibilityStates`.

Changes in this diff generally followed this pattern:

Before:
```
function accessibilityTraits(props: Props): Array<string> {
  const traits = ['button'];
  if (props.selected) {
    traits.push('selected');
  }
  return traits;
}

  <AdsManagerTouchableHighlight
        accessibilityTraits={accessibilityTraits(this.props)}
```

After:
```
function accessibilityStates(props: Props): Array<AccessibilityState> {
  const states = [];
  if (!props.enabled) {
    states.push('disabled');
  }
  if (props.checked) {
    states.push('selected');
  }
  return states;
}

  <AdsManagerTouchableHighlight
        accessibilityRole="button"
        accessibilityStates={accessibilityStates(this.props)}
```

Reviewed By: PeteTheHeat

Differential Revision: D8944741

fbshipit-source-id: 4b309d9c858e7e831fbf971aca2f546df7a1431d
2018-07-26 13:48:29 -07:00
..
AnimatedGratuitousApp Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
Thumbnails Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
ARTExample.js Switch to Platform.isTV to pass Android Flow 2018-06-10 13:45:57 -07:00
AccessibilityAndroidExample.android.js accessibilityTraits + accessibilityComponentType >> accessibilityRole + accessibilityStates 2/3 2018-07-25 23:48:26 -07:00
AccessibilityIOSExample.js accessibilityTraits + accessibilityComponentType >> accessibilityRole + accessibilityStates 3/3 2018-07-26 13:48:29 -07:00
ActionSheetIOSExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
ActivityIndicatorExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
AlertExample.js Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
AlertIOSExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
AnimatedExample.js Animated Example using Image 2018-06-20 23:48:18 -07:00
AppStateExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
AssetScaledImageExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
AsyncStorageExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
BorderExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
BoxShadowExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
ButtonExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
CameraRollExample.js Remove @providesModule from all modules 2018-04-25 07:37:10 -07:00
CameraRollView.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
CheckBoxExample.js Remove @providesModule from all modules 2018-04-25 07:37:10 -07:00
ClipboardExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
DatePickerAndroidExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
DatePickerIOSExample.js Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
DimensionsExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
ExampleTypes.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
FlatListExample.js Add FlatList and SectionList to Animated exports 2018-07-17 22:35:28 -07:00
GeolocationExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
ImageCapInsetsExample.js Stop expose Image.resizeMode 2018-05-12 23:25:09 -07:00
ImageEditingExample.js Add back ImageEditingExample example (#19972) 2018-07-01 16:32:07 -07:00
ImageExample.js Tightening the flow types for Image 2018-06-19 21:32:26 -07:00
InputAccessoryViewExample.js Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
KeyboardAvoidingViewExample.js Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
LayoutAnimationExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
LayoutEventsExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
LayoutExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
LinkingExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
ListExampleShared.js Switch to Platform.isTV to pass Android Flow 2018-06-10 13:45:57 -07:00
ListViewExample.js Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
ListViewGridLayoutExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
ListViewPagingExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
MaskedViewExample.js Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
ModalExample.js Switch to Platform.isTV to pass Android Flow 2018-06-10 13:45:57 -07:00
MultiColumnExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
NativeAnimationsExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
NavigatorIOSBarStyleExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
NavigatorIOSColorsExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
NavigatorIOSExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
NetInfoExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
OrientationChangeExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
PanResponderExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
PermissionsExampleAndroid.android.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
PickerExample.js Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
PickerIOSExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
PointerEventsExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
ProgressBarAndroidExample.android.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
ProgressViewIOSExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
PushNotificationIOSExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
RCTRootViewIOSExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
RNTesterActions.js Flow strictify possible files in RN core 2018-06-20 00:47:21 -07:00
RNTesterApp.android.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
RNTesterApp.ios.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
RNTesterBlock.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
RNTesterButton.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
RNTesterExampleContainer.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
RNTesterExampleList.js Switch to Platform.isTV to pass Android Flow 2018-06-10 13:45:57 -07:00
RNTesterList.android.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
RNTesterList.ios.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
RNTesterNavigationReducer.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
RNTesterPage.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
RNTesterSettingSwitchRow.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
RNTesterStatePersister.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
RNTesterTitle.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
RTLExample.js Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
RefreshControlExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
RootViewSizeFlexibilityExampleApp.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
SafeAreaViewExample.js Back out "[react-native][PR] Remove the deprecated `isIPhoneX_deprecated` constant" 2018-07-08 13:16:41 -07:00
ScrollViewExample.js Adding $FlowFixMe to invalid prop accesses 2018-05-12 10:35:27 -07:00
ScrollViewSimpleExample.js Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
SectionListExample.js Add FlatList and SectionList to Animated exports 2018-07-17 22:35:28 -07:00
SegmentedControlIOSExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
SetPropertiesExampleApp.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
ShareExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
SliderExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
SnapshotExample.js Remove @providesModule from all modules 2018-04-25 07:37:10 -07:00
StatusBarExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
SwipeableFlatListExample.js Remove @providesModule from all modules 2018-04-25 07:37:10 -07:00
SwipeableListViewExample.js Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
SwitchExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
TVEventHandlerExample.js Switch to Platform.isTV to pass Android Flow 2018-06-10 13:45:57 -07:00
TabBarIOSBarStyleExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
TabBarIOSExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
TextExample.android.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
TextExample.ios.js Switch to Platform.isTV to pass Android Flow 2018-06-10 13:45:57 -07:00
TextInputExample.android.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
TextInputExample.ios.js FlowType TextInput 2018-05-14 00:24:44 -07:00
TimePickerAndroidExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
TimerExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
ToastAndroidExample.android.js Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
ToolbarAndroidExample.android.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
ToolbarAndroidExample.ios.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
TouchableExample.js accessibilityTraits + accessibilityComponentType >> accessibilityRole + accessibilityStates 2/3 2018-07-25 23:48:26 -07:00
TransformExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
TransparentHitTestExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
URIActionMap.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
VibrationExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
VibrationIOSExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
ViewExample.js RNTester: Better View Overflow Example 2018-06-29 12:18:27 -07:00
ViewPagerAndroidExample.android.js Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
WebSocketExample.js Remove @providesModule from all modules 2018-04-25 07:37:10 -07:00
WebViewExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
XHRExample.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
XHRExampleBinaryUpload.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
XHRExampleCookies.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
XHRExampleDownload.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
XHRExampleFetch.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
XHRExampleFormData.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
XHRExampleHeaders.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
XHRExampleOnTimeOut.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
bunny.png Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
createExamplePage.js Prettier the rest of ReactNative 2018-05-11 13:52:30 -07:00
flux@3x.png fixed image in RNTester snapshot example 2017-08-31 15:16:05 -07:00
hawk.png Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
helloworld.html Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
http_test_server.js Prettier files with shebang 2018-05-11 13:52:30 -07:00
imageMask.png MaskedViewIOS -- A way to apply alpha masks to views on iOS 2017-07-11 15:05:57 -07:00
messagingtest.html Typos in comments and log messages 2018-01-12 22:18:45 -08:00
relay@3x.png fixed image in RNTester snapshot example 2017-08-31 15:16:05 -07:00
slider-left.png Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
slider-left@2x.png Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
slider-right.png Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
slider-right@2x.png Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
slider.png Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
slider@2x.png Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
uie_comment_highlighted@2x.png Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
uie_comment_normal@2x.png Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
uie_thumb_big.png Revert D5189017: [RN] Native implementation of <Image> intrinsic content size on iOS 2017-10-25 08:20:48 -07:00
uie_thumb_normal@2x.png Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
uie_thumb_selected@2x.png Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
websocket_test_server.js Prettier files with shebang 2018-05-11 13:52:30 -07:00