diff --git a/packages/react-native/src/private/components/switch/specs/SwitchNativeComponent.js b/packages/react-native/src/private/components/switch/specs/SwitchNativeComponent.js index caf83edcd48e..cbc48fc4296c 100644 --- a/packages/react-native/src/private/components/switch/specs/SwitchNativeComponent.js +++ b/packages/react-native/src/private/components/switch/specs/SwitchNativeComponent.js @@ -59,6 +59,10 @@ export const Commands: NativeCommands = codegenNativeCommands({ }); export default codegenNativeComponent('Switch', { + // @testing-library/react-native (as of 13.3.3) only recognizes a host + // component named `RCTSwitch` as a switch, so renaming this breaks every + // `*ByRole('switch')` query and `toBeChecked()` assertion in Jest. + paperComponentName: 'RCTSwitch', excludedPlatforms: ['android'], interfaceOnly: true, }) as ComponentType;