Skip to content

SVGs imports generated with defaultProps #238

@ogonkov

Description

@ogonkov

With config

"app-builder": {
  "lib": {
    "newJsxTransform": true,
    "internalDirs": [
      "src/components"
    ]
  }
},

SVG import like

import ChevronsLeftIcon from '@gravity-ui/icons/svgs/chevrons-left.svg';

console.log(ChevronsLeftIcon);

Transformed to JSX component with deprecated defaultProps, possibly caused by airbnb/babel-plugin-inline-react-svg#126

Details
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
import React from "react";
import { jsx as _jsx } from "react/jsx-runtime";
var ChevronsLeftIcon = function ChevronsLeftIcon(props) {
  return /*#__PURE__*/_jsx("svg", _objectSpread(_objectSpread({}, props), {}, {
    children: /*#__PURE__*/_jsx("path", {
      fill: "currentColor",
      fillRule: "evenodd",
      d: "M12.53 5.03a.75.75 0 0 0-1.06-1.06l-3.5 3.5a.75.75 0 0 0 0 1.06l3.5 3.5a.75.75 0 1 0 1.06-1.06L9.56 8zm-5 0a.75.75 0 0 0-1.06-1.06l-3.5 3.5a.75.75 0 0 0 0 1.06l3.5 3.5a.75.75 0 0 0 1.06-1.06L4.56 8z",
      clipRule: "evenodd"
    })
  }));
};
ChevronsLeftIcon.defaultProps = {
  xmlns: "http://www.w3.org/2000/svg",
  width: "16",
  height: "16",
  fill: "none",
  viewBox: "0 0 16 16"
};
console.log(ChevronsLeftIcon);
// #sourceMappingURL=index.js.map

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions