DEV Community

MD Taseen Khan
MD Taseen Khan

Posted on • Originally published at reactjsexample.com on

A simple Visual Studio Code plugin that converts html text to React JSX

Convert HTML to React JSX

A simple Visual Studio Code plugin that converts html text to React JSX

A simple Visual Studio Code plugin that converts html text to React JSX.

Just ctrl + shift + P -> Convert HTML to React JSX in the document you want to edit and run it.

A simple Visual Studio Code plugin that converts html text to React JSX

How does it work

It simply replaces html tags with React ones.

Here’s the current list:

var mapObj = {
  "class=": "className=",
  "for=": "htmlFor=",
  "-rule": "Rule",
  "stroke-l": "strokeL",
  "stroke-w": "strokeW",
  "<!--": "{/\*",
  "-->": "\*/}",
  tabindex: "tabIndex",
};
Enter fullscreen mode Exit fullscreen mode

Open a pull request to add missing rules.

GitHub

View Github

Top comments (0)