Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Incorrect import path for LocalSvg in react-native-qrcode-svg #234

Open
danielramireze opened this issue Jan 21, 2025 · 1 comment
Open

Comments

@danielramireze
Copy link

Hi! 👋

Today I used patch-package to patch [email protected] for the project I'm working on.

I encountered an issue while using [email protected] in my project. The import path for LocalSvg in the LogoSVG component appears to be incorrect. It is currently importing from react-native-svg/css, which causes an error. According to the react-native-svg documentation, LocalSvg should be imported directly from react-native-svg.

Proposed solution:

I made a small change to fix the import path in src/LogoSVG/index.native.js:

diff --git a/node_modules/react-native-qrcode-svg/src/LogoSVG/index.native.js b/node_modules/react-native-qrcode-svg/src/LogoSVG/index.native.js
index 6c5b14a..e1b5e5a 100644
--- a/node_modules/react-native-qrcode-svg/src/LogoSVG/index.native.js
+++ b/node_modules/react-native-qrcode-svg/src/LogoSVG/index.native.js
@@ -1,5 +1,5 @@
 import React from "react";
-import { LocalSvg } from "react-native-svg/css";
+import { LocalSvg } from 'react-native-svg'; 
 import { SvgUri, SvgXml } from "react-native-svg";
 import { isString, isUrlString } from "../utils";
 

This issue body was partially generated by patch-package.

This resolved the issue and everything now works as expected.

Hope this helps

@Kicu
Copy link
Member

Kicu commented Jan 22, 2025

Hello

react-native-svg documentation, LocalSvg should be imported directly from react-native-svg.

Can you point me in the specific place the documentation says that? I don't think that is true, and the import is correct.
This "issue" has been already reported multiple times, you can read more here: #225

As for a fix, please verify that you are using react-native-svg version 14.x or above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants