Closed Adnan-Bacic closed 2 years ago
I would recommend to use the version that comes shipped with react-native
.
It might be that if you install your own version, react-native
will anyway use it's own version instead of the one that you have installed.
something i have been unsure about for a while. but when using
react-native-svg
andreact-native-svg-transformer
, the documentation imports something from metro-config, like so:const { getDefaultConfig } = require("metro-config");
however neither documentation actually say you have to install
metro-config
first. when i search the project i see thatmetro-config
is already a dependency of@react-native-community/cli
. that package itself is a dependency ofreact-native
. so by default we always havemetro-config
in our project. so we dont NEED to install it.so since i usually install
metro-config
i feel like also have to remember to update it whenever i updatereact-native
so the versions match. this adds potentially unneeded manual work(that i may forget). however if i dont install it, it should just use the versionreact-native
uses, solving the problem of updating versions. maybe its not even needed that the versions match?so basically, should we install
metro-config
, or just rely on the version that our version ofreact-native
uses?