I'm having very weird behavior with React-native-svg
, for example i have sample circle like this:
<Circle
cx={props.x}
cy={props.y}
r={15}
// stroke={selected ? 'green' : 'white'}
stroke="green"
// strokeWidth={}
// fill="blue"
fill="none"
onPress={() => {
console.log('pressed', props.index);
clickable(!boolean);
setSelected(!selected);
}}
// fill={selected ? 'blue' : 'grey'}
/>
I can totally can click it, like normal, BUT , if i want another circle, or simply i put SVG wrap the circle, i can't not click on circle anymore!!! Why ???
<Svg> <========== I CAN NOT DO ANYTHING
<Circle
cx={props.x}
cy={props.y}
r={15}
// stroke={selected ? 'green' : 'white'}
stroke="green"
// strokeWidth={}
// fill="blue"
fill="none"
onPress={() => {
console.log('pressed', props.index);
clickable(!boolean);
setSelected(!selected);
}}
// fill={selected ? 'blue' : 'grey'}
/>
</Svg>
Even i put on press on SVG , but nothing happen, so if i want add press on SVG, how can i do that??
EDIT: I solve by replace SVG with G
<G> <------- it work ?????
<Circle
cx={props.x}
cy={props.y}
r={15}
stroke="green"
fill="none"
onPress={() => {
console.log('pressed', props.index);
clickable(!boolean);
setSelected(!selected);
}}
/>
</G>
So WHY it work with ???????