New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-convert-to-image

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-convert-to-image

Plugin to allow the download of any React component in project (whether currently rendered or not) as a image.

latest
Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
8
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

react-convert-to-image

Plugin to allow the download of React components as html on event trigger with/without preview.

NPM JavaScript Style Guide

Install

    npm install --save react-convert-to-image
    yarn add react-convert-to-image

Usage

  • Add <div id="download-comp"> to the index.tsx file of your project e.g.

    //... imports here
     import convertToImage from 'react-convert-to-image';
    
    const app = (
      <>
        // any outer wrappers can be used here
        <App />
        <div id="download-comp"></div>
      </>
    );
    
    ReactDOM.render(app, document.getElementById('root'));
    serviceWorker.unregister();
    
  • Pass the relevant parameters to the downloadSnapshotOfComponentAs

await convertToImage({
  componentToConvert: <MockComponent />,
  type: 'png'
});

License

MIT © deestewie

Keywords

screenshot

FAQs

Package last updated on 24 Jan 2023

Did you know?

Socket

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.

Install

Related posts