target / react-native-svg-parser

Parses SVG files and converts to 'react-native-svg' format objects. NOTE: This project has been archived.
MIT License
42 stars 16 forks source link

How can we add onPress in react-native-svg-parser? #16

Open harisanwar64 opened 6 years ago

harisanwar64 commented 6 years ago

Thanks for this great SVG parser. I want to do some action on different SVG parts on same screen so, how can we add onPress/onClick functionality in react-native-svg-parser? Just like,

<svg version="1.1" id="Layer_1" onPress=alert('Pressed!') xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 595.3 841.9" style="enable-background:new 0 0 595.3 841.9;" xml:space="preserve">

This returns an error.

Thanks in advance :)