question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I use this with Expo?

See original GitHub issue

I’m trying to use this with Expo, and when attempting to build the app, I get this error:

Unable to resolve "react-native-svg" from "node_modules/react-native-circular-progress/src/CircularProgress.js"

If I install react-native-svg, I get this error:

Tried to register two views with the same name RNSVGPath

I understand that Expo comes with its own react-native-svg already, which is why the error occurs. But react-native-circular-progress doesn’t use Expo’s SVG… so how am I supposed to get around this issue?

Modifying CircularProgress.js to use Expo’s SVG fixes this issue and works perfectly. But I’d prefer to use this without any modifications.

Any ideas?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

4reactions
phpsmartercommented, Mar 7, 2019

if you use expo ,need modify some code

because of expo redefine SVG code , need change some code in the source code

when you install npm package ,find pacakge and modify this file

./src/CircularProgress.js

import { Svg } from "expo";

<Svg
          width={size}
          height={size}
          style={{ backgroundColor: 'transparent' }}
        >
          <Svg.G rotation={rotation} originX={size/2} originY={size/2}>
            { backgroundColor && (
              <Svg.Path
                d={backgroundPath}
                stroke={backgroundColor}
                strokeWidth={backgroundWidth || width}
                strokeLinecap={lineCap}
                fill="transparent"
              />
            )}
            {fill > 0 && (
              <Svg.Path
                d={circlePath}
                stroke={tintColor}
                strokeWidth={width}
                strokeLinecap={lineCap}
                fill="transparent"
              />
            )}
          </Svg.G>
        </Svg>
2reactions
joelngwtcommented, Oct 30, 2018

I decided to use version 0.2.0 of this package. Works for me and there’s no issue with Expo

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expo Documentation
Create amazing apps that run everywhere. Build one JavaScript/TypeScript project that runs natively on all your users' devices.
Read more >
How to use Expo with React Native - Robin Wieruch
You will have to install the Expo Client from your App Store on your phone first. Other options include starting the app in...
Read more >
Building Your First React Native Application with Expo
We'll be using the Expo mobile app(Available on both Android and iOS) to simulate our app on mobile. Creating a new Expo project....
Read more >
Easier React Native Development With Expo - Code
Open the Expo client app on your phone and scan the code using the QR scanner. At this point, you should now be...
Read more >
Building Your First React Native Application with Expo - Medium
We'll be using the Expo mobile app(Available on both Android and iOS) to simulate our app on mobile. Creating a new Expo project....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found