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

feat: SvgFromUri/SvgFromXml add props onError execution #2132

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

H2-won
Copy link

@H2-won H2-won commented Sep 12, 2023

Summary

The onError function of the SvgFromUri / SvgFromXml component does not work.
According to the current code, there is no way to track if an error occurs in the component rendering.

Test Plan

What's required for testing (prerequisites)?

uri fetch fails.

What are the steps to reproduce (after prerequisites)?

Pass the onError function as props to test whether it is executed.

Compatibility

OS Implemented
iOS
Android ✅❌

Checklist

  • I have tested this on a device and a simulator
  • I added documentation in README.md
  • I updated the typed files (typescript)
  • I added a test for the API in the __tests__ folder

src/xml.tsx Outdated Show resolved Hide resolved
src/xml.tsx Outdated Show resolved Hide resolved
Co-authored-by: HUI <59960678+H2-won@users.noreply.github.com>
@WoLewicki
Copy link
Member

Could you resolve the failing CI job? It should be ready for merge then 🚀

resolve the failing CI job.
@H2-won
Copy link
Author

H2-won commented Mar 29, 2024

Could you resolve the failing CI job? It should be ready for merge then 🚀

@WoLewicki

I am very sorry for the late reply.

I expect TypeScript compilerOptions to be stable.
Perhaps the modified code will pass the CI job safely.

Please check new commit.
Also, I hope you compare the new commit with the code below and choose a better solution.

this.props.onError ? this.props.onError(e as Error) : console.error(e);

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.

None yet

2 participants