oktaysenkan / monicon

Universal Icon Library
https://monicon-docs.vercel.app
247 stars 9 forks source link

Error installing babel plugin #22

Closed HASH-0021 closed 2 months ago

HASH-0021 commented 2 months ago

I have followed the steps for installing the library. But I am getting error Error: Iconify: You need to install a Babel plugin before using this library. You can continue by adding the following to your babel.config.js while using any icons in the code.

Below are the files overview for reference.

package.json file

"dependencies": {
    "react": "18.2.0",
    "react-native": "0.74.3",
    "react-native-iconify": "^1.0.2",
    "react-native-svg": "^15.4.0"
  },
"devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native/babel-preset": "0.74.85",
    "@react-native/eslint-config": "0.74.85",
    "@react-native/metro-config": "0.74.85",
    "@react-native/typescript-config": "0.74.85",
    "@types/react": "^18.2.6",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.6.3",
    "eslint": "^8.19.0",
    "jest": "^29.6.3",
    "prettier": "2.8.8",
    "react-test-renderer": "18.2.0",
    "typescript": "5.0.4"
  },
  "engines": {
    "node": ">=18"
  },
  "packageManager": "yarn@3.6.4"
babel.config.js file

module.exports = {
  presets: ['module:@react-native/babel-preset'],
  plugins: ['react-native-iconify/plugin'],
};
HASH-0021 commented 2 months ago

<Iconify icon="mdi:heart" size={24} color="#900" /> line is causing this issue. More specifically, the color prop having #900 value. By changing the value to different color value, the issue is no longer present. Please fix the issue occurring when given this color prop value.

oktaysenkan commented 2 months ago

https://github.com/oktaysenkan/react-native-iconify?tab=readme-ov-file#iconify-you-need-to-install-a-babel-plugin-before-using-this-library-you-can-continue-by-adding-the-following-to-your-babelconfigjs