0.4.2 • Published 4 years ago

ts-transformer-svg-jsx v0.4.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

ts-transformer-svg-jsx

Transform SVG import into JSX.

Installation

Usage

Use with ttypescript.

{
  "compilerOptions": {
    "plugins": [{ "transform": "ts-transformer-svg-jsx/transform", "svgo": {} }]
  }
}

Use with Babel.

{
  "plugins": [["ts-transformer-svg-jsx/babel", { "svgo": {} }]]
}

Example:

import { svgToJsx } from "ts-transformer-svg-jsx";

const CloseIcon = svgToJsx("./close.svg");

function CloseButton() {
  return (
    <button>
      <CloseIcon />
      Close
    </button>
  );
}

License

MIT

0.4.1

4 years ago

0.4.0

4 years ago

0.4.2

4 years ago

0.3.3

4 years ago

0.3.0

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.2.2

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago