react-native-gradients icon indicating copy to clipboard operation
react-native-gradients copied to clipboard

Conflicts when user has other versions of `react-native-svg`

Open M-i-k-e-l opened this issue 6 months ago • 0 comments

We currently have a dependency on react-native-svg@npm:15.2.0.

react-native-gradients has a dependency on react-native-svg with a version of >=13.2.0 which installs react-native-svg@npm:15.12.1 - this causes an error (TypeError: Cannot read property 'LinearGradient' of undefined in our case).

I suspect this is the same issue as in #24.

Both can be worked-around using resolutions, in our case:

"resolutions": {
  "react-native-svg": "15.2.0"
},

But it can be easily solved on your end by moving the react-native-svg dependency from dependencies to peerDependencies (and possibly to devDependencies as well).

Note that this is technically a breaking change for users that are not installing react-native-svg themselves.

M-i-k-e-l avatar Aug 14 '25 08:08 M-i-k-e-l