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

How to avoid default undefined parameters in various components? #3517

Closed
psk-dreampay opened this issue Dec 8, 2022 · 10 comments
Closed

How to avoid default undefined parameters in various components? #3517

psk-dreampay opened this issue Dec 8, 2022 · 10 comments
Labels
question Question related to the library, not an issue

Comments

@psk-dreampay
Copy link

psk-dreampay commented Dec 8, 2022

I just upgrade the react native paper version to 5.0.1. Everything else seems fine but how can I avoid some compulsory parameters where the value of these parameters can be undefined. To give more details when working checkbox the following code was working properly before this update:

<Checkbox.Android status={status} onPress={onPress} disabled={disabled} testID={testID} theme={theme} uncheckedColor={uncheckedColor} color={color} />

But after the update I have to pass some additional parameters as follows:

<Checkbox.Android status={status} onPress={onPress} disabled={disabled} testID={testID} theme={theme} uncheckedColor={uncheckedColor} color={color} // new params accessibilityLabelledBy={undefined} accessibilityLanguage={undefined} onPointerEnter={undefined} onPointerEnterCapture={undefined} onPointerLeave={undefined} onPointerLeaveCapture={undefined} onPointerMove={undefined} onPointerMoveCapture={undefined} onPointerCancel={undefined} onPointerCancelCapture={undefined} onPointerDown={undefined} onPointerDownCapture={undefined} onPointerUp={undefined} onPointerUpCapture={undefined} onHoverIn={undefined} onHoverOut={undefined} delayHoverIn={undefined} delayHoverOut={undefined} />
Anything we can do here to just skip this parameters. This is happening with other components as well like
Fab, HelperText, IconButton, RadioButton, TextInput, AppBar.BackAction and TextInput.Icon.

@psk-dreampay psk-dreampay added the question Question related to the library, not an issue label Dec 8, 2022
@lukewalczak
Copy link
Member

Please check if adding @types/[email protected] will solve your issue.

@psk-dreampay
Copy link
Author

It's working now thanks a lot @lukewalczak

@elilabes
Copy link

elilabes commented Jan 18, 2023

@lukewalczak I have tried installing @types/[email protected] and the current release @types/[email protected]. Neither version fixes this issue for me. It started for me after upgrading from 5.0.0-rc9 to 5.1.3.

For me it is accessibilityLabelledBy and accessibilityLanguage that are required for every react-native-paper component

Any ideas? :)

@raajnadar
Copy link
Collaborator

@elilabes did you try deleting & regenerating the lock (yarn.lock or package.lock) file?

@elilabes
Copy link

@raajnadar yes - same issue

@warrenfalk
Copy link

I am also seeing this issue: react-native-paper@^5.1.3, @types/[email protected] (also occurs with 0.71.0)

The issue is that react-native-paper/lib/typescript/components/TextInput/TextInput.d.ts does a Pick<> on import("react-native").TextInputProps with "accessibilityLabelledBy" and "accessibilityLanguage" which do not exist on that type

@warrenfalk
Copy link

It looks like these two properties were only merged into the react-native typescript definitions a few hours ago facebook/react-native#35883 and facebook/react-native#35883

I'm not sure how react-native-paper already had them before react-native did, nor why a search in react-native-paper github does not find these in the code.

@DimitarNestorov
Copy link
Contributor

@warrenfalk @elilabes 5.1.4 was just released. Can you try updating and let us know if you have any issues?

@warrenfalk
Copy link

After updating to 5.1.4, I no longer see the issue 👍️🙏

@elilabes
Copy link

Working now! Thanks @DimitarNestorov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question related to the library, not an issue
Projects
None yet
Development

No branches or pull requests

6 participants