svgr
Transform SVGs into React components. More information: https://react-svgr.com/docs/options/.
- Transform an SVG file into a React component to
stdout:
svgr --
- Transform an SVG file into a React component using TypeScript to
stdout:
svgr --typescript --
- Transform an SVG file into a React component using JSX transform to
stdout:
svgr --jsx-runtime automatic --
- Transform all SVG files from a directory to React components into a specific directory:
svgr --out-dir
- Transform all SVG files from a directory to React components into a specific directory skipping already transformed files:
svgr --out-dir --ignore-existing
- Transform all SVG files from a directory to React components into a specific directory using a specific case for filenames:
svgr --out-dir --filename-case
- Transform all SVG files from a directory to React components into a specific directory without generating an index file:
svgr --out-dir --no-index
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
