No component found for view with name "RNSVGRect" : latest version used, no peer dependency errors
See original GitHub issueI’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:
- Created 6 years ago
- Reactions:8
- Comments:5
Top GitHub Comments
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
For me this solves the problem #387 . Remove “libRNSVG-tvOS.a” in xcode and restart the project. Svg will work just fine.