react-native-svg icon indicating copy to clipboard operation
react-native-svg copied to clipboard

feat: SvgFromUri/SvgFromXml add props onError execution

Open H2-won opened this issue 2 years ago • 2 comments

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

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

H2-won avatar Sep 12 '23 09:09 H2-won

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

WoLewicki avatar Jan 05 '24 14:01 WoLewicki

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);

H2-won avatar Mar 29 '24 20:03 H2-won

Hello @H2-won,

Thank you so much for your time and for all that you do. We have closed the PR case as we have already implemented part of your changes in our codebase. Nevertheless, we truly appreciate your contributions. Thank you again.

bohdanprog avatar Jul 10 '24 12:07 bohdanprog