Skip to content
This repository was archived by the owner on Apr 1, 2023. It is now read-only.
This repository was archived by the owner on Apr 1, 2023. It is now read-only.

How to import svg as component #223

Open
@rimlin

Description

@rimlin

Using CRA, i was able to import svg like component and inline it:
import { ReactComponent as skip } from '../../../assets/icons/skip.svg';
But if i try it, i will get an error:

Error: 'ReactComponent' is not exported by src/assets/icons/skip.svg, imported by src/components/shared/Icon/Icon.component.tsx

If i import like this:
import skip from '../../../assets/icons/skip.svg';
i will get link to svg, but i need inline svg code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions