pressing the button to get the base64 string of the svg ... produces the following error:
- Only the original thread that created a view hierarchy can touch its views
render() {
return (
<ScrollView contentContainerStyle={styles.container}>
<Svg
ref={c => (this.svg = c)}
height="50%"
width="50%"
viewBox="0 0 100 100"
>
<Circle
cx="50"
cy="50"
r="45"
stroke="blue"
strokeWidth="2.5"
fill="green"
/>
</Svg>
<TouchableOpacity
onPress={() => {
this.svg.toDataURL(data => {
console.log("data", data);
});
}}
>
<Text>Get Data</Text>
</TouchableOpacity>
</ScrollView>
);
}
Any help?