Open thednp opened 3 months ago
@cqh963852, could you take a look at this?
@cqh963852 sorry to bother you, I believe you need to export something like this
// vanjs-jsx/src/index.js
import van from "vanjs-core";
export function createState(v) {
return van.state(v);
}
export const Fragment = (props) => props.children; // <<<<<<<<<<<<< THIS
export { default as createElement, default as jsx, default as jsxDEV } from "./createElement";
Another option would be something like Solid has implemented with "jsx": "preserve"
and not rely on React's usage of className
and htmlFor
. But that's just an opinion, we might want to accommodate both React devs and new comers. @Tao-VanJS thoughts?
"jsx": "preserve"
solidjs has its own babel transform.
I tend to fork the react's compiler to do this work.
className and htmlFor
I can understand your expectation.
Do you mean it to be more like writing html?
<label for="xxx" />
<div class="xxx" />
A react compiler example
react compiler does not implement the build time reconcile part
A solidjs example
Personally, I don't like the For tag.
Hi @Tao-VanJS, I'm getting this error:
Perhaps including something in compileOptions or the jsx-runtime would fix this? Let me try and let you know later ;)
Btw, I'm using the default bare example converted to JSX