module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: [
// for short paths, must be mirrored with tsconfig
[
'module-resolver',
{
extensions: ['.ts', '.tsx', '.js', '.jsx', '.ios.js', '.android.js'],
alias: {
'@app': './src',
},
},
],
[
'react-native-iconify/babel',
{
icons: [
'mdi:heart',
'mdi:home',
'mdi:account',
'feather:activity',
// Add more icons here
],
},
],
// fix for web caused by react-native-reanimated
// https://github.com/software-mansion/react-native-reanimated/issues/1823#issuecomment-1384307084
'@babel/plugin-proposal-export-namespace-from',
'react-native-reanimated/plugin',
],
};
};
ERROR Error: [React Native Iconify]
Icon "mdi:heart" not found in babel.config.js
You need to add it to the "icons" array in the plugin options and restart the bundler.
Example:
[
"react-native-iconify",
{ icons: ["mdi:home"] }
]
This error is located at:
in P (created by SearchBar)
in RCTView (created by View)
in View
in View (created by SearchBar)
in RCTView (created by View)
in View
in View (created by SearchBar)
in RCTView (created by View)
in View
...............................................
<Iconify icon="mdi:heart" size={24} color="#900" />