Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to recover original code file parsed by React build?

I'm working on React old projects and several of them have the native structure, like:

...{
    key: "render",
    value: function () {
      return React.createElement(
        "div",
        {
          className: "WrapperExamQuery",
          id: "IndexComponent",
        },
        React.createElement(
          "div",
          {
            className: "loadingWraper",
          },
          React.createElement(
            "div",
            {
              className: "teamLoading",
            },
            React.createElement("span", null, "loading... ")...

In my actual working team, nobody knows why is this, and don't find the orignal code (if exist). Is there a tool to parse o unparse these files to work with React jsx normally? any advise will be welcome. Thanks!

like image 842
bluesky777 Avatar asked Oct 18 '25 06:10

bluesky777


1 Answers

We ran into the same issue a long time ago. And then we tried this library. It's not maintained anymore but you can try

https://github.com/JoeStanton/babel-transform-js-to-jsx

I hope it help :)

like image 198
Sodhi saab Avatar answered Oct 20 '25 22:10

Sodhi saab