Inconsistent documentation on mandatory `textAlign` prop of `TextInput` component
See original GitHub issueCurrent behaviour
The documentation of TextInput does not specify textAlign as a prop of the component, however TypeScript compiler complains about the lack of it if you don’t specify it.
Expected behaviour
Either it should be dropped as a mandatory property so no compiler error or update documentation to involve textAlign property and mark it as mandatory (and also add it to the example).
Code sample
<TextInput label={content.login.inputLabel} value={id} onChangeText={handleChange} textAlign={textAlign} />
What have you tried
Passing either left or right helps obviously.
Your Environment
| software | version |
|---|---|
| react-native | 0.63.2 |
| react-native-paper | 4.7.2 |
| react-native-vector-icons | 8.0.0 |
| node | 14.15.0 |
| yarn | 1.22.5 |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:17 (4 by maintainers)
Top Results From Across the Web
How to align text input correctly in react native? - Stack Overflow
I have found the solution that in Android, TextInput style textAlignVertical: 'top' works. but in ios, TextInput prop multiline={true} works.
Read more >text-align - CSS: Cascading Style Sheets - MDN Web Docs
The text-align CSS property sets the horizontal alignment of the inline-level content inside a block element or table-cell box.
Read more >TextInput - React Native
A foundational component for inputting text into the app via a keyboard. Props provide configurability for several features, such as auto- ...
Read more >TextAlign - Android Developers
Public companion functions; Public companion properties; Public functions ... TextAlign controls how text aligns in the space it appears.
Read more >Alexa.Presentation.APL Interface Reference | Alexa Skills Kit
This property contains a map in which the key for each item is the URI for ... to copy a code snippet with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Do you also have problem with any
<Text />component wanting adataDetectorTypeproperty?I had the same issue and it’s gone once I’ve bumped up
@types/react-nativeto the0.63.52. Try this 😃