Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove testID from TextStyle types (#38053)
Summary: `testID` which is a valid prop for `<Text>` is also found in the types for `TextStyle`. This pull request removes said property from the styles. ## Changelog: General Fixed - Remove testID from TextStyle types Pull Request resolved: #38053 Test Plan: ```tsx const styles = StyleSheet.create({ view: { testID: 'should-error-in-typescript-but-does-not' } }) ``` `TextStyle` is used to type the `StyleSheet` along with `ViewStyle` and `ImageStyle` which do not contain `testID`. ```tsx const MyText = <Text testID="already-typed-fine">Hello</Text> ``` `testID` is used to identify components with the mentioned prop. This works for `Text` and will continue to do so, `TextProps` has `testID` added specifically. When using `getByTestId` in jest adding testID to the style already has no effect. When adding `testID` to a style a warning will already be shown in development: Warning: Failed prop type: Invalid props.style key `testID` supplied to `Text`. Reviewed By: javache Differential Revision: D47006787 Pulled By: NickGerleman fbshipit-source-id: 6993579ee9c173677594f8f3aea499ac8d8ab232
- Loading branch information