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

Error: Text strings must be rendered within a <Text> component. #201

Open
DTanmoy opened this issue May 2, 2020 · 14 comments
Open

Error: Text strings must be rendered within a <Text> component. #201

DTanmoy opened this issue May 2, 2020 · 14 comments

Comments

@DTanmoy
Copy link

DTanmoy commented May 2, 2020

No description provided.

@wagnerpaz
Copy link

Same here!

@DeVoresyah
Copy link

same

@mainsmirnov
Copy link

Same

@alikrodrigues
Copy link

Same..

@chenweigh
Copy link

Same

@theroshanjha01
Copy link

same here

@ziudeso
Copy link

ziudeso commented Jul 2, 2020

same

@Ilya1995
Copy link

+1

1 similar comment
@PZenha
Copy link

PZenha commented Jul 31, 2020

+1

@bitttttten
Copy link

Sometimes you get this if your svg has inlined raster graphics. You can test by opening your svg in illustrator or something like that, finding the raster graphics and deleting them, then testing the svg.

You could also look at different export options for your svg in illustrator, if you "embed" images you might have more success.

@leovargasdev
Copy link

I was also having the same problem, but I found the react-native-svg package, worked for me!

Example:

import { SvgUri } from 'react-native-svg';

<SvgUri
      width="200"
      height="200"
      uri="http://thenewcode.com/assets/images/thumbnails/homer-simpson.svg"
/>

@factorycreacom
Copy link

I was also having the same problem, but I found the react-native-svg package, worked for me!

Example:

import { SvgUri } from 'react-native-svg';

<SvgUri
      width="200"
      height="200"
      uri="http://thenewcode.com/assets/images/thumbnails/homer-simpson.svg"
/>

Thanks. worked for me

@chloe-schoreisz
Copy link

I don't know why, but react-native-svg is not working on my end. I'm encountering this issue for svgs generated through Illustratror (which is what our designer uses to create them).

Any ideas ? Or anyone knows how to set up illustrator so that it doesn't create these comments ?

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" .... >
<style type="text/css">
.st0{fill:#0C3276;}
</style>
<g>
	<path ... />
	<path ... />
	<path ... />
</g>
</svg>

@sunjungAn
Copy link

sunjungAn commented Jul 9, 2023

check your svg file.
i had the same issue, i resolve my issue.
remove comment and any semicolon in svg string

ex) <!-- Generator: ~~ -->

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