Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent documentation on mandatory textAlign prop of TextInput component #2558

Closed
latobibor opened this issue Feb 23, 2021 · 17 comments
Closed

Comments

@latobibor
Copy link

latobibor commented Feb 23, 2021

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
@github-actions
Copy link

Couldn't find version numbers for the following packages in the issue:

  • react-native-vector-icons

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

  • react-native (found: 0.63.2, latest: 0.63.4)
  • yarn (found: 1.22.5, latest: 1.22.10)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

@latobibor latobibor changed the title Inconsistent TypeScript types and documentation on textAlign of TextInput component Inconsistent documentation on mandatory textAlign prop of TextInput component Feb 23, 2021
@github-actions
Copy link

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

  • react-native (found: 0.63.2, latest: 0.63.4)
  • yarn (found: 1.22.5, latest: 1.22.10)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

@latobibor
Copy link
Author

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

  • react-native (found: 0.63.2, latest: 0.63.4)
  • yarn (found: 1.22.5, latest: 1.22.10)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

Yes, since it is a type and documentation related problem.

@Robbilie
Copy link

Robbilie commented Mar 8, 2021

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

@dariomalfatti-centropaghe

I have the same problem (textAlign props missing) with react-native-paper 4.7.2 but with the 4.7.1 it works.

@latobibor
Copy link
Author

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

@wobsoriano
Copy link
Contributor

Any updates on this?

@lukewalczak
Copy link
Member

Does the issue still occur for you in the latest paper version (4.8.1)?

@dariomalfatti-centropaghe

Yes, it occurs in the latest version 4.8.1

@lukewalczak
Copy link
Member

Does that happen for other components and props? Could you please to provide some example?

@dariomalfatti-centropaghe

I'm using react-native-paper 4.7.1 with Typescript. If I update to 4.8.1, Typescript compiler raise an error that TextInput and SearchBar need textAlign property. Setting it to undefined, it compile.
I don't know if other components has this issue but on my project I'm using quite all paper compoments.

@TMaszko
Copy link

TMaszko commented May 18, 2021

Which version of @types/react-native are you using in your projects ?

@dariomalfatti-centropaghe

@types/react-native: 0.63.30

@TMaszko
Copy link

TMaszko commented 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 :)

@dariomalfatti-centropaghe

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

@Nikolay-Vovk-dataart
Copy link

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

Agreed. Just updated the types to latest version and now its working

@lukewalczak
Copy link
Member

Since we have two confirmations that upgrading @types/react-native solves the issue, I'm closing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants