xxxxxxxxxx
{
"presets": [
[
"@babel/preset-react",
{
"runtime": "automatic",
"importSource": "react",
"development": false
}
]
]
}
xxxxxxxxxx
// change the code here!!
// runtime "automatic" adds imports, will be default in Babel 8
// importSource defaults to "react"
<div></div>;
<h1>hi</h1>;
<Component/>;
<Component {props} />;
<Component {props} prop="a"/>;
<Component prop="a" key="b" />;
const profile = (
<>
<img src="avatar.png" className="profile" />
<h3>{[user.firstName, user.lastName].join(" ")}</h3>
</>
);
xxxxxxxxxx
import { jsxs as _jsxs } from "react/jsx-runtime";
import { Fragment as _Fragment } from "react/jsx-runtime";
import { jsx as _jsx } from "react/jsx-runtime";
// change the code here!!
// runtime "automatic" adds imports, will be default in Babel 8
// importSource defaults to "react"
/*#__PURE__*/
_jsx("div", {});
/*#__PURE__*/
_jsx("h1", {
children: "hi"
});
/*#__PURE__*/
_jsx(Component, {});
/*#__PURE__*/
_jsx(Component, { props
});
/*#__PURE__*/
_jsx(Component, { props,
prop: "a"
});
/*#__PURE__*/
_jsx(Component, {
prop: "a"
}, "b");
const profile = /*#__PURE__*/_jsxs(_Fragment, {
children: [/*#__PURE__*/_jsx("img", {
src: "avatar.png",
className: "profile"
}), /*#__PURE__*/_jsx("h3", {
children: [user.firstName, user.lastName].join(" ")
})]
});
xxxxxxxxxx
{
"presets": [
[
"@babel/preset-react",
{
"runtime": "classic",
"pragma": "React.createElement",
"pragmaFrag": "React.Fragment",
"development": false,
"useSpread": true
}
]
]
}
xxxxxxxxxx
// change the code here as well!!
import React from "react";
// runtime "classic" is default in Babel 7
// pragma defaults to "React.createElement"
<div></div>;
<h1>hi</h1>;
<Component/>;
<Component {props} />;
<Component {props} prop="a"/>;
<Component prop="a" key="b" />;
const profile = (
<>
<img src="avatar.png" className="profile" />
<h3>{[user.firstName, user.lastName].join(" ")}</h3>
</>
);
xxxxxxxxxx
// change the code here as well!!
import React from "react"; // runtime "classic" is default in Babel 7
// pragma defaults to "React.createElement"
/*#__PURE__*/
React.createElement("div", null);
/*#__PURE__*/
React.createElement("h1", null, "hi");
/*#__PURE__*/
React.createElement(Component, null);
/*#__PURE__*/
React.createElement(Component, { props
});
/*#__PURE__*/
React.createElement(Component, { props,
prop: "a"
});
/*#__PURE__*/
React.createElement(Component, {
prop: "a",
key: "b"
});
const profile = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("img", {
src: "avatar.png",
className: "profile"
}), /*#__PURE__*/React.createElement("h3", null, [user.firstName, user.lastName].join(" ")));