5.4.3 • Published 4 years ago

@koorya/babel-plugin-add-jsx-attribute-width-id v5.4.3

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

@svgr/babel-plugin-add-jsx-attribute

Install

npm install --save-dev babel-plugin-add-jsx-attribute-width-id

Usage

svgr config

jsx: {
  babelConfig: {
    plugins: [
      [
        "babel-plugin-replace-jsx-attribute-value-with-id",
        {
          ids: ["rect", "Y4"],
          attributes: [
            {
              name: "onClick",
              value: "props.clickfn",
              spread: false,
              literal: true,
              position: "end",
            },
            {
              name: "fill",
              value: (id) => "props?." + id + ' ? "#0f0" : "#faa"',
              spread: false,
              literal: false,
              position: "end",
            },
          ],
        },
      ],
    ];
  }
}

License

MIT

5.4.3

4 years ago

5.4.2

4 years ago

5.4.1

4 years ago

5.4.0

4 years ago