Commit 4b23deb
Add missing textAlignVertical on TextInputAndroidProps (Flow)
Summary:
**Motivation**
[`textAlignVertical`](https://reactnative.dev/docs/text-style-props#textalignvertical-android) is a real, documented prop which exists on the manual TS types but was not defined in Flow.
The prop reaches `<AndroidTextInput>` at runtime via a spread operation:
https://www.internalfb.com/code/fbsource/[35bb10d088a0]/xplat/js/react-native-github/packages/react-native/Libraries/Components/TextInput/TextInput.js?lines=653-656
**This change**
Type missing prop, exposing this API to Flow and the generated Strict API types — annotated with `platform android`.
**Sidenote: Should this prop exist?**
`<TextInput>` also respects `style: {verticalAlign: 'auto' | 'bottom' | 'middle' | 'top'}`, mapping this to `textAlignVertical` on Android — **they are equivalent**.
Therefore, it's tempting to drop `textAlignVertical` entirely, however neither it nor `style.verticalAlign` are implemented on iOS — therefore the explicit prop with `platform android` edges out. This diff upholds the current state of the world.
Changelog:
[General][Fixed] - **Strict TypeScript API**: Add missing `textAlignVertical` prop on `<TextInput>`
Differential Revision: D1061839841 parent 97aa7ad commit 4b23deb
2 files changed
Lines changed: 12 additions & 4 deletions
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
509 | 516 | | |
510 | 517 | | |
511 | 518 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
5051 | 5051 | | |
5052 | 5052 | | |
5053 | 5053 | | |
| 5054 | + | |
5054 | 5055 | | |
5055 | 5056 | | |
5056 | 5057 | | |
| |||
6135 | 6136 | | |
6136 | 6137 | | |
6137 | 6138 | | |
6138 | | - | |
6139 | | - | |
| 6139 | + | |
| 6140 | + | |
6140 | 6141 | | |
6141 | 6142 | | |
6142 | 6143 | | |
| |||
6145 | 6146 | | |
6146 | 6147 | | |
6147 | 6148 | | |
6148 | | - | |
| 6149 | + | |
6149 | 6150 | | |
6150 | 6151 | | |
6151 | 6152 | | |
| |||
0 commit comments