Skip to content

Latest commit

 

History

History
33 lines (20 loc) · 1000 Bytes

README.en_US.md

File metadata and controls

33 lines (20 loc) · 1000 Bytes

中文 | English

npm

Convert the SVG code to the React component code.

Installation

NPM

npm add svg-to-component-parse

Usage

  • Convert the SVG code to the React component code.
import { generateReact } from 'svg-to-component-parse';

const result = generateReact('YourComponentName', '<svg>...your svg code</svg>');
  • Get the code of the related module of the React component

The helper and utils modules are referenced in the React component code, and this method provides the code and relative paths of these modules.

import { generateComponentUtils } from 'svg-to-component-parse';

const result = generateComponentUtils();