vault-development / react-native-svg-uri

Render SVG images in React Native from an URL or static file
849 stars 334 forks source link

Getting errors while trying to run #77

Closed HeroSizy closed 3 months ago

HeroSizy commented 7 years ago
jietu20170904-231624

error copied: import SvgUri from 'react-native-svg-uri';

code:

import SvgUri from 'react-native-svg-uri';

//in Component
renderListItems () {

        const list = [
                {
                    uri: "../image/constant/homer-simpson.svg"
                },
            ]
        ;

        return list.map((l, i) =>
            <ListItem
                key={i}
                title={
                    <SvgUri height="150" width="200" source={require(l.uri)}/>
                }
            />
        );
    }
matc4 commented 7 years ago

Hello @HeroSizy

If you do:

<SvgUri height="150" width="200" source={require("../image/constant/homer-simpson.svg")}/>

Works?

arturkasprzyk commented 7 years ago

Hey, got exactly the same problem today on Android emulator ;)

mhotakai commented 6 years ago

The release is not compatible with React 16 because PropTypes has been removed from the react package. That seems to be fixed in the master branch but I ran into other problems...

(Now it works. Had to apply these fixes to react-native-svg@6.0.0-rc1: https://github.com/react-native-community/react-native-svg/issues/460, https://github.com/react-native-community/react-native-svg/issues/387)

lxlneo commented 6 years ago

fix the PropTypes ,but another problems