question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistent documentation on mandatory `textAlign` prop of `TextInput` component

See original GitHub issue

Current 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:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
latobiborcommented, Apr 14, 2021

Do you also have problem with any <Text /> component wanting a dataDetectorType property?

2reactions
TMaszkocommented, May 19, 2021

I had the same issue and it’s gone once I’ve bumped up @types/react-native to the 0.63.52. Try this 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found