React-native-svg-charts: Expo 31 react-native-svg import issue

Created on 11 Feb 2019  路  13Comments  路  Source: JesperLekland/react-native-svg-charts

After upgrading to Expo 31 I get an error that the package "react-native-svg" can't be found. I also had to remove react-native-svg from my dependencies since Expo now exports it.

I fixed it as below, but this seems messy and I'm not sure on the correct fix. react-native-svg is listed as a peerDependency in react-native-svg-charts, which It thought should make it work with Expo.

https://github.com/vjsingh/react-native-svg-charts/commit/298f3718b147358a68f07a1104d657ab1540bf86

awaiting response 馃挰

All 13 comments

i have the same issue

I'm also experiencing this issue

the same issue

the same

Is there a fix for this issue? I am experiencing it as well :(

facing same issue, looking forward to a solution

+1

Facing the same issue. Anybody figured it out?

@Jimexa Try this one
https://www.npmjs.com/package/react-native-pure-chart

@seersol92 Thanks for the suggestion! Have already tried this one but couldn't fiddle with it's animations. They seem to be hard to configure. (Excuse my ignorance in advance if they prove to be highly configurable :))

Hi all,

JesperLekland did / does a great job maintaining this library, and it is a great library. Since it appears it's not actively maintained anymore though, I've switched over to Victory Charts and am pretty happy with it. Don't mean any disrespect against the contributors to this repo since as I said I think they've done a great job. Just my 2 cents

@vjsingh I tried to run this library in Expo SDK 35, this doesn't seem to be an issue anymore.
And as I can see, the Expo documentation, mentions to import as a separate package:
https://docs.expo.io/versions/latest/sdk/svg/

For those still having this issue, I solved it by updating my app.json file with the following:

"packagerOpts": {
  "config": "metro.config.js",
  "sourceExts": [
    "js",
    "jsx",
    "svg",  // added this
    "ts", // added this
    "tsx", // added this
    "css"
  ]
}

Also make sure you install SVG with expo install react-native-svg
(Running with Expo SDK 35)

Was this page helpful?
0 / 5 - 0 ratings