There is a component function:
function Component() {
const content = 123 + 456
return <div>{content}</div>
}
I want to convert the whole function as it is to a string:
function App() {
const str = Component.toString()
console.log(str)
return (
<div>{str}</div>
)
}
But the result is not what I expected:
function Component() {
const content = 123 + 456;
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
children: content
})
}
Here is a sample on CodeSandbox