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 lack of onError event for Windows #3247

Merged
merged 3 commits into from
Sep 19, 2023

Conversation

chrisglein
Copy link
Contributor

@chrisglein chrisglein commented Sep 19, 2023

The native code was receiving the event, but not reasing the event. Which apparently needs to be prefixed with "top" and then that turns into "onError".

Note that this raises the event, but no error object is included. Better than nothing.

How tested

const [videoHasError, setVideoHasError] = useState(false);

...

const shouldShowVideo = videoThumbnail && hovering && !videoHasError;

...

        { shouldShowVideo &&
            <Video
              source={{uri: videoThumbnail.uri}}
              paused={!hovering}
              repeat={true}
              resizeMode='cover'
              onError={() => setVideoHasError(true)}
              style={{
                width: '100%',
                aspectRatio: videoThumbnail.width / videoThumbnail.height,
                borderRadius: 5,
                borderWidth: 1,
                borderColor: hovering ? 'black' : 'lightgray'
              }}
              />
        }
  • After you open the PR, update the CHANGELOG.md file with an entry pointing to your PR.

The native code was receiving the event, but not reasing the event.
Which [apparently](microsoft/react-native-windows#4206) needs to be prefixed with "top" and then that turns into "onError".

Note that this raises the event, but no error object is included. Better than nothing.
@freeboub freeboub merged commit ef5c63f into TheWidlarzGroup:master Sep 19, 2023
1 check passed
@chrisglein chrisglein deleted the windowsOnError branch September 19, 2023 19:52
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.

2 participants