
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
render-react-native-to-image
Advanced tools
Take a React Native component tree, and render it into an SVG or PNG image.
(based on jest-snapshots-svg by @orta over at Artsy)
Our goal with this is to function as a more human-viewable snapshot, a companion to jest json snapshots. Commit both to your repository, and the machine can diff the json to show if something changed, while you can look at the generated images to see what changed and how.
Very alpha.
If it proves useful at Khan Academy, I might turn it into something much more streamlined.
import * as React from "react"
import { Text } from "react-native"
import * as renderer from "react-test-renderer"
import {renderToSVGString, renderToCanvas} from "render-react-native-to-image"
describe("Fixtures", () => {
it("does some simple JSX", () => {
const component = renderer.create(<Text>Hello</Text>).toJSON()
expect(component).toMatchSnapshot()
renderToCanvas('./example.png', component)
fs.writeFileSync('./example.svg', renderToSVGString(component))
})
})
MIT
FAQs
Generate an SVG or PNG image of a React Native Component Tree
We found that render-react-native-to-image 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.