Tried to register two views with the same name RNSVGRect

4.4k Views Asked by At

Facing this issue, when I am using two libraries react-native-d3multiline-chart for line chart and for the bar chart I am using react-native-svg-charts. Both the libraries are using same react-native-svg, when I am using react-native-svg, it is showing the above error. How can we fix it?

1

There are 1 best solutions below

0
On BEST ANSWER

Use the library npm-force-resolutions, This modifies package-lock.json to force the installation of specific version of a transitive dependency (dependency of dependency), made the following changes to your package.json

"resolutions": {
     "hoek": "4.2.1"
}

"scripts": {
  "preinstall": "npx npm-force-resolutions"
}

remove and install node_modules

rm -rf node_modules && npm install

hope this will work for you.