I want to render simple svg on Expo, but the below error code is shown.
Uncaught Error: ReferenceError: Can't find variable: React
My code:
import * as React from 'react';
import { Component } from 'react';
import { View, Text} from 'react-native';
import Svg, { Circle, Rect } from 'react-native-svg';
export default class Chart extends Component {
render() {
return (
<View>
<Svg height="20" width="20">
<Circle cx="10" cy="10" r="10" fill="red" />
</Svg>
</View>
);
}
}
My dependencies are as below.
Expo cli: 3.27.4
"expo": "~37.0.3",
"react": "~16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
"react-native-svg": "11.0.1",
Please advise if you know how to solve this issue. Thanks!