Is there a tool to convert React Elements javascript code to JSX

Viewed 3756

It's not difficult to find a tool to convert JSX to React.createElement, something like this:

  <div className="commentBox">
    Hello, world! I am a CommentBox.
  </div>

to this:

  React.createElement('div', {className: "commentBox"},
    "Hello, world! I am a CommentBox."
  )

I can't find a tool co make a convertation vice-versa. I have a big codebase with React.createElement, and I want to transform it to plain JSX. How can I do it?

1 Answers
Related