software-mansion / software-mansion/react-native-svg
Web: onClick property not respected
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8k
- Forks
- 1.2k
- Avg merge
- 10d 9h
- Merged PRs (30d)
- 2
Description
Description
My project is a web application.
I use onClick for Svg icons in my app and it worked on 14.1.0, but when i upgraded to 15.12 the onClick callback never gets triggered when i click the Svg (web). Changing it to onPress fixes the issue, and now i know that onClick is not idiomatic for react-native libs, but:
- I would expect onClick to be also respected in web environment
- if this is the intended behavior, the component should now allow
onClickand there should be type errors
If i understood correctly this is introduced in 15.5 (issue not present in 15.4).
Steps to reproduce
- usereact-native-svg version 15.5 or later
- Create Svg with onClick property
- That onClick is not respected and there are no type errors
Snack or a link to a repository
https://snack.expo.dev/@jiojosbg/isnored-onclick-15-5-0
SVG version
15.12.0
React Native version
0.81.5
Platforms
Web
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Snack reproduction and compare react-native-svg 15.4 with 15.5 or later on the web. Trace the SVG onClick handling and its TypeScript types; done when the behavior matches the intended contract, either by triggering the callback or reporting a type error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100