tom555my / react-native-avataaars

React Native component for Avataaars
MIT License
22 stars 16 forks source link

WebView error newer React-Native version #10

Open NilsBaumgartner1994 opened 2 years ago

NilsBaumgartner1994 commented 2 years ago
Invariant Violation: WebView has been removed from React Native. It can now be installed and imported from 'react-native-webview' instead of 'react-native'. See https://github.com/react-native-community/react-native-webview
hellohellosharp commented 2 years ago

Forget this library, its no longer maintained.

Instead, use

import { SvgUri } from 'react-native-svg';
export default function ComponentWithSvg() {
  return (
       <SvgUri
           width="28"
           height="28"
           uri="https://avataaars.io/?avatarStyle=Transparent&topType=LongHairMiaWallace&accessoriesType=Kurt&hairColor=BlondeGolden&facialHairType=BeardMedium&clotheType=GraphicShirt&clotheColor=Black&eyeType=Happy&eyebrowType=AngryNatural&mouthTy"
       />
  );
}
JacobDel commented 1 year ago

@hellohellosharp You can't use a dynamic URL to display an SVG image. To display an SVG image you need a direct link.

This is a blank component:

       <SvgUri
           width="28"
           height="28"
           uri="https://avataaars.io/?avatarStyle=Transparent&topType=LongHairMiaWallace&accessoriesType=Kurt&hairColor=BlondeGolden&facialHairType=BeardMedium&clotheType=GraphicShirt&clotheColor=Black&eyeType=Happy&eyebrowType=AngryNatural&mouthTy"
       />
JacobDel commented 1 year ago

updated package that works on RN 0.70.6: https://github.com/JacobDel/react-native-avataaars