-
-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Would be nice to convert Nano JSX to and from an AST.
const App = () => {
return (
<div>
<h1 style="color: blue;">title</h1>
<p>paragraph</p>
</div>
)
}
const tree = renderToTree(<App />)
// tree would be something like this:
{
type: 'FC',
name: 'App',
children: [
{
type: 'html',
name: 'div',
children: [
{ type: 'html', name: 'h1', body: 'title', props: { style: 'color: blue;' } },
{ type: 'html', name: 'p', body: 'paragraph' }
]
}
]
}
// modify the tree if needed and render it to html
const html = renderFromTree(tree)
JayaKrishnaNamburu, jrson83, fusionstrings, danielsteuri, iamyuu and 1 more
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request