0

I have the following error when I try to use react-native-svg:

error-screenshot

I use react-native-svg like this in my code: code-screenshot

and I call the component like this

import BarChart from './BarChart'

// ...

I am using react-native-svg : 9.13.3 and expo : 36 I installed react-native-svg with expo install react-native-svg and I already try to relaunch with reset cache..... save me please lol have a nice day !

norbitrial
  • 14,716
  • 7
  • 32
  • 59

1 Answers1

0

The issue is most probably coming from how you import your Svg.

From the documentation I found if you are using Expo, then you need to import as:

/* Use this if you are using Expo */

import * as Svg from 'react-native-svg';
const { Circle, Rect } = Svg;

Instead of your example:

import Svg, { Circle, Rect } from 'react-native-svg';

See under Usage section.

norbitrial
  • 14,716
  • 7
  • 32
  • 59