![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@datacamp/react-native-svg-uri
Advanced tools
Render SVG images in React Native from an URL or a static file
This was tested with RN 0.33 and react-native-svg 4.3.1 (depends on this library) react-native-svg
Not all the svgs can be rendered, if you find problems fill an issue or a PR in order to contemplate all the cases
Install library from npm
npm install @datacamp/react-native-svg-uri --save
Link library react-native-svg
react-native link react-native-svg # not react-native-svg-uri !!!
Prop | Type | Default | Note |
---|---|---|---|
source | ImageSource | Same kind of source prop that <Image /> component has | |
svgXmlData | String | You can pass the SVG as String directly | |
fill | Color | Overrides all fill attributes of the svg file | |
classes | Object | Overrides attributes of classes, only those attributes present in the given object |
Here's a simple example:
import SvgUri from 'react-native-svg-uri';
const TestSvgUri = () => (
<View style={styles.container}>
<SvgUri
width="200"
height="200"
source={{uri:'http://thenewcode.com/assets/images/thumbnails/homer-simpson.svg'}}
classes={{'cls-1': {strokeWidth: 5}}}
/>
</View>
);
or a static file
<SvgUri width="200" height="200" source={require('./img/homer.svg')} />
This will render:
npm i
npm test
FAQs
Render an SVG Image from an URL
The npm package @datacamp/react-native-svg-uri receives a total of 3 weekly downloads. As such, @datacamp/react-native-svg-uri popularity was classified as not popular.
We found that @datacamp/react-native-svg-uri demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.