eftalyurtseven / react-native-wheel-of-fortune

React Native Wheel of Fortune Plugin
103 stars 89 forks source link

Tried to register two views with same name RNSVGRect #29

Open siddesh94 opened 3 years ago

siddesh94 commented 3 years ago

i already have react-native-svg and react-native-svg-charts in package.json i got this error after installing react-native-wheel-of-fortune Screenshot_1627984127

Ketan2010 commented 3 years ago

Hi @siddesh94,

  1. go inside node_modules folder of you project: image

  2. Then go inside react-native-wheel-of-fortune folder and delete node_modules folder inside that. image

as node_module folder of your project as well as node_module folder of react-native-wheel-of-fortune contains react-native-svg module hence this error occurred.

  1. Rebuild your app and enjoy spinning the wheel :)
kvntzn commented 2 years ago

Another is using patch package, while the solution of deleting react native svg works but you have to do it over again when you newly install this package. react-native-wheel-of-fortune+1.5.4.patch

diff --git a/node_modules/react-native-wheel-of-fortune/src/index.js b/node_modules/react-native-wheel-of-fortune/src/index.js
index 0cdb2a1..a18e66c 100644
--- a/node_modules/react-native-wheel-of-fortune/src/index.js
+++ b/node_modules/react-native-wheel-of-fortune/src/index.js
@@ -9,7 +9,7 @@ import {
 } from 'react-native';
 import * as d3Shape from 'd3-shape';

-import Svg, {G, Text, TSpan, Path, Pattern} from 'react-native-svg';
+import Svg, {G, Text, TSpan, Path, Pattern} from '../../react-native-svg';

 const AnimatedSvg = Animated.createAnimatedComponent(Svg);

@@ -313,7 +313,7 @@ class WheelOfFortune extends Component {
             source={
               this.props.options.knobSource
                 ? this.props.options.knobSource
-                : require('../assets/images/knob.png')
+                : require('../../../assets/knob.png')
             }
             style={{ width: knobSize, height: (knobSize * 100) / 57 }}
           />