Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@berndschrooten/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 @berndschrooten/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 |
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'}}
/>
</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 @berndschrooten/react-native-svg-uri receives a total of 0 weekly downloads. As such, @berndschrooten/react-native-svg-uri popularity was classified as not popular.
We found that @berndschrooten/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 1 open source maintainer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.