Skip to content

Web: onClick property not respected #2865

@JIOjosBG

Description

@JIOjosBG

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 onClick and there should be type errors

If i understood correctly this is introduced in 15.5 (issue not present in 15.4).

Steps to reproduce

  1. usereact-native-svg version 15.5 or later
  2. Create Svg with onClick property
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions