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

fix(ReactVideoProps): add accessibility & testID in typing #3434

Conversation

delphinebugner
Copy link
Contributor

@delphinebugner delphinebugner commented Dec 20, 2023

Change Description

Fixes #3427

As suggested, ReactVideoProps now extends AccessibilityProps.
The testID has been added on its own, as in ViewPropsTypes in React Native!

Test plan

I tested this on my project ; we have now :

  • No TS error when adding testID or accessibility props in a Video
import Video, { ReactVideoProps } from 'react-native-video';

export const TF1Video = (props: ReactVideoProps) => {
  return (
    <Video
      accessibilityHint="A React Native Video" // ✅ ts okay
      accessibilityLabel="A good React Native Video label" // ✅ ts okay
      testID="rn-video" // ✅ ts okay
      {...props}
    />
  );
};
  • Autocompletion
image
  • We still have screen.getByLabelText('"A good React Native Video label') working using RNTL
  • We still have all props appearing in spnashots :
exports[`React Native Video renders correctly`] = `
  <RCTVideo
    accessibilityHint="A React Native Video"
    accessibilityLabel="A good label"
    {...}
    testID="rn-video"
  />

Checks

[ x ] No need for doc update
[ ] Changelog modified -> no but is it this still needed?

Copy link
Collaborator

@KrzysztofMoch KrzysztofMoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🙌

@KrzysztofMoch KrzysztofMoch merged commit d986b7b into TheWidlarzGroup:master Dec 21, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typing - Missing accessibilityLabel in ReactVideoProps
3 participants