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.

Text strings must be rendered within a <Text> component

See original GitHub issue

Hey guys. I have an issue for which I couldn’t find any information. Most likely it is not a bug with the library but something I am doing wrong, I just couldn’t figure out what can cause the problem. So The problem itself is that I receive a very strange error for which I will attach an image of my simulator. Simulator Screen Shot - iPhone 11 - 2021-05-07 at 14 25 33

That happens using SvgUri from the react-native-svg like this

<SvgUri
  uri={silkUrl}
  height={svgSilkHeight}
  width={svgSilkWidth}                              
/>

Versions:

“react-native”: “0.63.4”, “react”: “16.13.1”, “react-native-svg”: “12.1.1”,

If some more info is needed I will add it. Thanks in advance 😃

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
petkovvcommented, May 8, 2021

The problem is not reproducible on version 11.0.1 of the library. At least for me downgrading to 11.0.1 worked. 😃

0reactions
NilsBaumgartner1994commented, Jun 16, 2022

getting the same error for this svg:

<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 180 180" width="300" height="300"><metadata><rdf:RDF><cc:Work><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title>Bottts</dc:title><dc:creator><cc:Agent><dc:title>Pablo Stanley</dc:title></cc:Agent></dc:creator><dc:source>https://bottts.com/</dc:source><cc:license rdf:resource="https://bottts.com/"/><dc:contributor><cc:Agent><dc:title>Florian Körner</dc:title></cc:Agent></dc:contributor></cc:Work></rdf:RDF></metadata><mask id="avatarsRadiusMask"><rect width="180" height="180" rx="0" ry="0" x="0" y="0" fill="#fff"/></mask><g mask="url(#avatarsRadiusMask)"><g transform="translate(0, 66)"><g opacity="0.9"><path fill-rule="evenodd" clip-rule="evenodd" d="M32.5 41C41.6127 41 49 32.9411 49 23C49 13.0589 41.6127 5 32.5 5C23.3873 5 16 13.0589 16 23C16 32.9411 23.3873 41 32.5 41Z" stroke="#2A3544" stroke-width="6"/><path d="M29.5152 36.7649C22.1017 41.0451 12.5101 38.3112 8.0918 30.6585" stroke="#2A3544" stroke-width="4"/><path fill-rule="evenodd" clip-rule="evenodd" d="M28 67C37.3888 67 45 60.5081 45 52.5C45 44.4919 37.3888 38 28 38C18.6112 38 12 44.4919 12 52.5C12 60.5081 18.6112 67 28 67Z" stroke="#2A3544" stroke-width="4"/><path d="M168.606 60.4234C164.326 53.0099 154.653 50.5817 147 55" stroke="#2A3544" stroke-width="4"/><path fill-rule="evenodd" clip-rule="evenodd" d="M148 38C157.389 38 165 31.0604 165 22.5C165 13.9396 157.389 7 148 7C138.611 7 132 13.9396 132 22.5C132 31.0604 138.611 38 148 38Z" stroke="#2A3544" stroke-width="6"/></g><path fill-rule="evenodd" clip-rule="evenodd" d="M145 0C143.895 0 143 0.89543 143 2V20C143 21.1046 143.895 22 145 22H157C158.105 22 159 21.1046 159 20V2C159 0.895431 158.105 0 157 0H145ZM23 27C21.8954 27 21 27.8954 21 29V47C21 48.1046 21.8954 49 23 49H35C36.1046 49 37 48.1046 37 47V29C37 27.8954 36.1046 27 35 27H23ZM24 60C22.8954 60 22 60.8954 22 62V70C22 71.1046 22.8954 72 24 72H36C37.1046 72 38 71.1046 38 70V62C38 60.8954 37.1046 60 36 60H24ZM143 44C143 42.8954 143.895 42 145 42H157C158.105 42 159 42.8954 159 44V62C159 63.1046 158.105 64 157 64H145C143.895 64 143 63.1046 143 62V44Z" fill="#273951"/><mask id="sidesCables01Mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="21" y="0" width="138" height="72"><path fill-rule="evenodd" clip-rule="evenodd" d="M145 0C143.895 0 143 0.89543 143 2V20C143 21.1046 143.895 22 145 22H157C158.105 22 159 21.1046 159 20V2C159 0.895431 158.105 0 157 0H145ZM23 27C21.8954 27 21 27.8954 21 29V47C21 48.1046 21.8954 49 23 49H35C36.1046 49 37 48.1046 37 47V29C37 27.8954 36.1046 27 35 27H23ZM24 60C22.8954 60 22 60.8954 22 62V70C22 71.1046 22.8954 72 24 72H36C37.1046 72 38 71.1046 38 70V62C38 60.8954 37.1046 60 36 60H24ZM143 44C143 42.8954 143.895 42 145 42H157C158.105 42 159 42.8954 159 44V62C159 63.1046 158.105 64 157 64H145C143.895 64 143 63.1046 143 62V44Z" fill="white"/></mask><g mask="url(#sidesCables01Mask0)"><rect width="180" height="76" fill="#FFA726"/></g></g><g transform="translate(41, 0)"><path fill-rule="evenodd" clip-rule="evenodd" d="M23 22C20.2386 22 18 24.2386 18 27V40H12C10.8954 40 10 40.8954 10 42V52H18H34H42H58H66H82H90V42C90 40.8954 89.1046 40 88 40H82V27C82 24.2386 79.7614 22 77 22H71C68.2386 22 66 24.2386 66 27V40H58V27C58 24.2386 55.7614 22 53 22H47C44.2386 22 42 24.2386 42 27V40H34V27C34 24.2386 31.7614 22 29 22H23Z" fill="#E1E6E8"/><mask id="topLightsMask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="10" y="22" width="80" height="30"><path fill-rule="evenodd" clip-rule="evenodd" d="M23 22C20.2386 22 18 24.2386 18 27V40H12C10.8954 40 10 40.8954 10 42V52H18H34H42H58H66H82H90V42C90 40.8954 89.1046 40 88 40H82V27C82 24.2386 79.7614 22 77 22H71C68.2386 22 66 24.2386 66 27V40H58V27C58 24.2386 55.7614 22 53 22H47C44.2386 22 42 24.2386 42 27V40H34V27C34 24.2386 31.7614 22 29 22H23Z" fill="white"/></mask><g mask="url(#topLightsMask0)"><rect width="100" height="52" fill="#FFA726"/><rect width="100" height="40" fill="white" fill-opacity="0.6"/><rect x="24" y="28" width="4" height="8" rx="2" fill="white" fill-opacity="0.6"/><rect x="48" y="28" width="4" height="8" rx="2" fill="white" fill-opacity="0.6"/><rect x="72" y="28" width="4" height="8" rx="2" fill="white" fill-opacity="0.6"/></g></g><g transform="translate(25, 44)"><rect width="130" height="120" rx="18" fill="#0076DE"/><mask id="faceSquare01Mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="130" height="120"><rect width="130" height="120" rx="18" fill="white"/></mask><g mask="url(#faceSquare01Mask0)"><rect x="-2" y="-2" width="134" height="124" fill="#FB8C00"/> undefined </g></g><g transform="translate(52, 124)"><path d="M27.0493 8.44151C26.8055 7.36419 27.4811 6.29318 28.5584 6.04935C29.6358 5.80551 30.7068 6.48119 30.9506 7.55851C31.72 10.9578 34.4016 13 37.9999 13C41.5983 13 44.2799 10.9578 45.0493 7.55851C45.2931 6.48119 46.3641 5.80551 47.4414 6.04935C48.5188 6.29318 49.1944 7.36419 48.9506 8.44151C47.7599 13.7024 43.4298 17 37.9999 17C32.5701 17 28.24 13.7024 27.0493 8.44151Z" fill="black" fill-opacity="0.6"/></g><g transform="translate(38, 76)"><rect x="8" y="10" width="88" height="36" rx="4" fill="black" fill-opacity="0.8"/><rect x="28" y="21" width="10" height="17" rx="2" fill="#5EF2B8"/><rect x="66" y="21" width="10" height="17" rx="2" fill="#5EF2B8"/><path fill-rule="evenodd" clip-rule="evenodd" d="M83 10H88L76 46H71L83 10Z" fill="white" fill-opacity="0.4"/></g></g></svg>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Invariant Violation: Text strings must be rendered within a ...
Invariant Violation: Text strings must be rendered within a <Text> component. 99% of cases will be caused by using conditional rendering ...
Read more >
How to handle the error “Text strings must be rendered within ...
The first cause for the error is because of bad indentation. It is very necessary that each component is indented properly. The child...
Read more >
Text strings must be rendered within a Text component
Hello learners,In this video I have explained why you get this error( Text strings must be rendered within a Text component ) and...
Read more >
Text strings must be rendered within a <Text> component ...
Empty string scenario: ... Let's say one of your variables you're trying to use for conditional rendering evaluates to an empty state. Guess...
Read more >
Text Strings must be rendered within a <Text> component
Invariant Violation: Text strings must be rendered within a component. This error is located at: in RCTView (at View.js:45) in View (at header....
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