Skip to content

Inline SVG to React by Vite #10

Description

@ai

I am taking about files like https://github.com/mikhin/vite-figma/blob/main/src/ui/components/Lurkers.tsx

Having SVG in JSX files leads to a few problems:

  1. You can’t view SVG files in system image viewer
  2. You can’t edit SVG files in GUI editor
  3. You can’t use scripts like svgo on these SVG files

Vite has a few tools to convert SVG file to React component automatically https://dev.to/cassidoo/importing-svg-files-as-react-components-with-vite-l3n

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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