wix / react-native-ui-lib

UI Components Library for React Native
https://wix.github.io/react-native-ui-lib/
MIT License
6.45k stars 706 forks source link

Cannot use Image SVG #2221

Closed thanhloc-17 closed 2 years ago

thanhloc-17 commented 2 years ago

Hi, I installed RNUILib by rnn-starter, when I use Image component with SVG then I get some error as below:

image

My component: <Image source={{uri: 'http://thenewcode.com/assets/images/thumbnails/homer-simpson.svg'}} />

Here my dependencies from package.json:

"dependencies": { "@kanzitelli/if-component": "^0.3.0", "@react-native-async-storage/async-storage": "^1.16.2", "@react-native-community/blur": "^3.6.0", "axios": "^0.27.2", "css-to-react-native": "^3.0.0", "date-fns": "^2.28.0", "expo": "^44.0.6", "expo-linear-gradient": "~11.0.3", "expo-localization": "^12.0.1", "formik": "^2.2.9", "i18n-js": "^3.8.0", "lodash": "^4.17.21", "lottie-react-native": "^5.1.4", "mobx": "^6.4.2", "mobx-persist-store": "^1.0.6", "mobx-react": "^7.3.0", "react": "^17.0.2", "react-native": "^0.67.3", "react-native-config": "^1.4.6", "react-native-gesture-handler": "^2.3.2", "react-native-mmkv": "^2.2.0", "react-native-navigation": "^7.26.0", "react-native-navigation-hooks": "^6.3.0", "react-native-reanimated": "^2.4.1", "react-native-restart": "^0.0.24", "react-native-ui-lib": "^6.11.0", "react-native-vector-icons": "^9.1.0", "rn-bounceable": "^1.1.0", "rnn-screens": "^0.2.0", "styled-components": "^5.3.5", "twrnc": "^3.4.0" },

"devDependencies": { "@babel/core": "^7.17.7", "@babel/preset-typescript": "^7.16.7", "@babel/runtime": "^7.17.7", "@react-native-community/eslint-config": "2.0.0", "@tsconfig/react-native": "^1.0.4", "@types/i18n-js": "^3.8.2", "@types/jest": "^27.4.1", "@types/lodash": "^4.14.180", "@types/react": "^17.0.40", "@types/react-native": "^0.67.3", "@types/react-native-vector-icons": "^6.4.10", "@types/react-test-renderer": "^17.0.1", "@typescript-eslint/eslint-plugin": "^5.15.0", "@typescript-eslint/parser": "^5.15.0", "babel-jest": "^27.5.1", "dotenv-cli": "^5.0.0", "eslint": "7.14.0", "eslint-config-google": "^0.14.0", "eslint-plugin-prettier": "3.3.1", "eslint-plugin-unused-imports": "^2.0.0", "jest": "^27.5.1", "metro-react-native-babel-preset": "^0.69.1", "patch-package": "^6.4.7", "postinstall-postinstall": "^2.1.0", "prettier": "^2.5.1", "react-test-renderer": "^17.0.2", "release-it": "^14.12.5", "typescript": "^4.6.2" },

What should I do to fix this bug or I have made a mistake when install RNUILib?

Thank you in advance.

decoderid commented 2 years ago

install this package

react-native-svg react-native-svg-transformer

thanhloc-17 commented 2 years ago

fixed