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

Property 'State' is missing in type 'CompoundedComponent' but required in type 'typeof TextInput' #4123

Closed
victorlavrenko opened this issue Oct 11, 2023 · 2 comments

Comments

@victorlavrenko
Copy link

Current behaviour

I'm trying to use Paper's TextInput in other components that expect typeof React Native's TypeInput, however, fail:

Property 'State' is missing in type 'CompoundedComponent' but required in type 'typeof TextInput'.

Expected behaviour

I think Paper's TextInput shall support Static property. It's in there at least since the split of types at React Native that happened more than a year ago.

How to reproduce?

Try the following in TypeScript:

TextInput as typeof ReactTextInput

          <PhoneInput
            ref={phoneInputRef}
            initialCountry={countryCode.toLowerCase()}
            autoFormat={true}
            textProps={{ autoComplete: "tel", autoFocus: true, inputMode: "tel", placeholder: "Your Phone Number" }}
            onPressFlag={switchVisible}
            onChangePhoneNumber={(phone, country) => onPhoneInputChange(phone, country)}
            textComponent={TextInput as typeof ReactTextInput}  // Using TextInput from react-native-paper
          />

Preview

What have you tried so far?

Your Environment

software version
react-native 0.72.5
react-native-paper 5.10.6
@github-actions
Copy link

Hey! Thanks for opening the issue. Can you provide a minimal repro which demonstrates the issue? Posting a snippet of your code in the issue is useful, but it's not usually straightforward to run. A repro will help us debug the issue faster. Please try to keep the repro as small as possible. The easiest way to provide a repro is on snack.expo.dev. If it's not possible to repro it on snack.expo.dev, then you can also provide the repro in a GitHub repository.

Copy link

Hello 👋, this issue has been open for more than a month without a repro or any activity. If the issue is still present in the latest version, please provide a repro or leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution or workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix 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

2 participants