How To Convert SVG to JSX

Since, I have started building Ultimate Blocks, I have been using SVG icons as the icon of the blocks.

But to use them with the blocks, the better way is to convert them to JSX and use them. Here’s how I do it.

Convert SVG to JSX

Open the SVG file with any editor. Copy the whole code.

Go to SVG to JSX. Paste the code on the left box. And your JSX will be available on the right box.

Click on Copy to copy the JSX.

Here’s how I use the JSX on my block.

Now, I can import ‘icon’ anywhere I want and use it.

Hope this quick little tip helps you.

Leave a Reply

Your email address will not be published. Required fields are marked *