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

Please update examples to use proper Svg import #2023

Closed
Romick2005 opened this issue Apr 4, 2023 · 5 comments
Closed

Please update examples to use proper Svg import #2023

Romick2005 opened this issue Apr 4, 2023 · 5 comments

Comments

@Romick2005
Copy link

Romick2005 commented Apr 4, 2023

Please replace

import Svg, {
  Path,
  Text,...
} from "react-native-svg";

with

import {
  Path,
  Svg,
  Text,...
} from "react-native-svg";

in usage examples to get rid off eslint no-named-as-default warnings/errors:
Using exported name 'Svg' as identifier for default export import/no-named-as-default

image

Also in PointerEventsBoxNone.tsx and Test1374.tsx

@bohdanprog
Copy link
Member

Hello @Romick2005,
I checked the PointerEventsBoxNone component but I didn't have any issues.

If you still have any problems feel free to open a new issue.
Thank you.

@Romick2005
Copy link
Author

Romick2005 commented Jun 19, 2024

So what is the recommended way to import Svg component properly?
import Svg from "react-native-svg";
Or
import { Svg } from "react-native-svg"

What would you recommend @bohdanprog?

@Romick2005
Copy link
Author

Romick2005 commented Jun 19, 2024

Please check this line and this to get more info for this case.

@bohdanprog
Copy link
Member

bohdanprog commented Jun 19, 2024

@Romick2005 Thanks, I understand your point. I believe you can import the SVG in whichever way you prefer.
It is a remnant from the past, the removal of which would be a breaking change, so we are unlikely to do it.

@Romick2005
Copy link
Author

Agree. But we can update examples to demonstrate preferable usage which I believe is import { Svg } from "react-native-svg"

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