react-native-paper: Inconsistent documentation on mandatory `textAlign` prop of `TextInput` component

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

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 8
  • Comments: 17 (4 by maintainers)

Most upvoted comments

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

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

Ive been working in my project for weeks and suddenly i get the error that i am missing the textAlign prop. it started around the time i began integrating react-navigation and its theme bottom navigation

Yes, it works. react-native-paper 4.8.1 with @types/react-native 0.63.52 works fine, thanks!