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.

No component found for view with name "RNSVGRect" : latest version used, no peer dependency errors

See original GitHub issue

I’ve searched and have found similar issues that have been closed in the recent past, but I cannot figure out why I’m getting this issue. Also, there seems to be similar ones, but I get this error with out any peer dependency errors.

When attempting to render the SVG by calling the class, the error gets thrown. Dismissing the error in my iOS simulator will show the SVG viewing area (a box with a red border) but not the filled Rectangle.

ERROR:

`No component found for view with name “RNSVGRect”

-[RCTUIManager createView:viewName:rootTag:props:] RCTUIManager.m:1007 invoking_ -[NSInvocation invoke] -[NSInvocation invokeWithTarget:] -[RCTModuleMethod invokeWithBridge:module:arguments:] facebook::react::RCTNativeModule::invokeInner(unsigned int, folly::dynamic const&&) facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&):😒_0::operator()() const invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&) _dispatch_call_block_and_release _dispatch_client_callout _dispatch_queue_serial_drain _dispatch_queue_invoke _dispatch_root_queue_drain _dispatch_worker_thread3 _pthread_wqthread start_wqthread`

Code to follow:

package.json { “name”: “geEnglishApp”, “version”: “0.0.1”, “private”: true, “scripts”: { “start”: “node node_modules/react-native/local-cli/cli.js start”, “test”: “jest” }, “dependencies”: { “react”: “16.0.0-alpha.12”, “react-native”: “0.45.1” }, “devDependencies”: { “babel-jest”: “20.0.3”, “babel-preset-react-native”: “2.0.0”, “jest”: “20.0.4”, “react-test-renderer”: “16.0.0-alpha.12” }, “jest”: { “preset”: “react-native” } }

sample code with SVG put in for testing purposes. index.ios.js

`/**

Sample React Native App https://github.com/facebook/react-native @flow */ import React, { Component } from ‘react’; import { AppRegistry, StyleSheet, Text, View } from ‘react-native’;

import Svg,{ Circle, Ellipse, G, LinearGradient, RadialGradient, Line, Path, Polygon, Polyline, Rect, Symbol, Use, Defs, Stop } from ‘react-native-svg’;

export default class geEnglishApp extends Component { render() { return (

Welcome to React Native!

To get started, edit index.ios.js

Press Cmd+R to reload,{‘\n’} Cmd+D or shake for dev menu

); } }

class SvgExample extends Component { render() { return ( <Svg width=“200” height=“60”

<Rect x="25" y="5" width="150" height="50" fill="rgb(0,0,255)" strokeWidth="3" stroke="rgb(0,0,0)" /> ); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: ‘center’, alignItems: ‘center’, backgroundColor: ‘#F5FCFF’, }, welcome: { fontSize: 20, textAlign: ‘center’, margin: 10, }, instructions: { textAlign: ‘center’, color: ‘#333333’, marginBottom: 5, }, });

AppRegistry.registerComponent(‘geEnglishApp’, () => geEnglishApp);

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
coolguy001tvcommented, Jul 19, 2017

I solved this problem by adding RNSVG.xcodeproj(from node_modules/react-native-svg/ios/) into my rn project. Then it works on IOS. I didn’t meet any errors following the readme, including react-native link react-native-svg. But it seems that the link failed?

react-native 0.46.0 react-native-svg 5.3.0 react 16.0.0-alpha.12

2reactions
alanbocommented, Jul 4, 2017

For me this solves the problem #387 . Remove “libRNSVG-tvOS.a” in xcode and restart the project. Svg will work just fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No component found for view with name "RNSVGRect" : latest ...
I've searched and have found similar issues that have been closed ... name "RNSVGRect" : latest version used, no peer dependency errors #382....
Read more >
(react-native-svg Error) "Tried to register two views with the ...
I am using yarn and npm to add modules. I get an error message: "Tried to register two views with the same name...
Read more >
npm Peer Dependencies - Fathom
When you use peer dependencies, npm will not automatically install those dependencies (see comments above in respect to npm version 7). This can...
Read more >
react-native-svg - npm
SVG library for react-native. Latest version: 13.6.0, last published: a month ago. Start using react-native-svg in your project by running ...
Read more >
npm Peer Dependencies - JavaScript inDepth
In this article I clarify what npm Peer Dependencies are and especially when you should use them. Peer Dependencies are listed in the...
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