I just removed React Native Vector Icons because I don't want to use it.
It causes me some bug on react-native link... So I unlink it and remove it from my project.
But now after 2 hours I found why my projects fails with this error :
https://github.com/facebook/react-native/issues/24094
It seems your package use React Native Vector Icons but when I delete it, so it causes bug on your package :
error: bundling failed: Error: Unable to resolve module react-native-vector-icons/MaterialIcons from /front/node_modules/react-native-paper/src/components/Icon.js: Module react-native-vector-icons/MaterialIcons does not exist in the Haste module map
Now I'm stuck, what can I do?
We mention this in our getting started guide.

https://github.com/satya164/babel-plugin-optional-require#usage
Hello @satya164
So I see I have to install Babel-plugin-option-required.
But what do I have to add in blacklist and whitelist?
Do you have a config to opt out react Native vector icons?
@Steffi3rd you just need to add the plugin and run react-native start --reset-cache to start the packager. No additional config is needed.
@satya164 Add the plugin as in install it or add it to babelConfig.js? I'm also having issues opting out of this...
EDIT: Never mind got it working!
For the people interested:
babel.config.js needs to look like this:
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
env: {
production: {
plugins: ['react-native-paper/babel'],
},
},
plugins: ['optional-require'],
};
@x5engine Author of vector-icons put a lot of effort in making this library and you're blaming it because it doesn't work for you... that's rude
@Trancever I apologize :) the author indeed did a very good job but those errors seem frustrating sometimes after spending days trying to fix that building and rebuilding your app.
Most helpful comment
@satya164 Add the plugin as in install it or add it to babelConfig.js? I'm also having issues opting out of this...
EDIT: Never mind got it working!
For the people interested:
babel.config.js needs to look like this: