import React from 'react'; import * as Svg from 'react-native-svg'; import Example from './Example'; const { Circle, Path, Rect, G, Text, ClipPath, Defs } = Svg; class PressExample extends React.Component { static title = 'Press on the red circle or long press on the blue rectangle to trigger the events'; render() { return ( alert('Press on Circle')} /> alert('Long press on Rect')} /> ); } } class HoverExample extends React.Component { static title = 'Hover the svg path'; state = { hover: false, }; toggle = () => { this.setState((prevState) => ({ hover: !prevState.hover })); }; render() { return ( ); } } class GroupExample extends React.Component { static title = 'Bind touch events callback on Group element with viewBox'; render() { return ( alert('Pressed on G')}> alert('Pressed on Text')}> H ); } } const icon = ( ); const TouchEvents: Example = { icon, samples: [PressExample, HoverExample, GroupExample], }; export default TouchEvents;