feathericons / feathericons/feather

Feacture Request: Add support for JSX

Open
#709 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
26k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

## Prerequisites

Any version of React using JSX

## Step to reproduce

When trying to get the icon to render is react, by doing this:

`{Feather.icons["arrow-down"].toSvg()}`

It will return the as plain text, due to it not being JSX.

What you currently need to is is put it in a div, and use `dangerouslySetInnerHTML`, to make it render:
```


```

## Any message or error
I would recommend a function that return a JSX svg element, which could be called something like `.toJSX()`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.