vanjs-org / van

🍦 VanJS: World's smallest reactive UI framework. Incredibly Powerful, Insanely Small - Everyone can build a useful UI app in an hour.
https://vanjs.org
MIT License
3.77k stars 87 forks source link

[vanjs-jsx] style property no more handled #328

Open damienflament opened 3 months ago

damienflament commented 3 months ago

The style property is no more added to the resulting HTML elements.

Previously, the style property was handled differently:

https://github.com/vanjs-org/van/blob/2c6536e7a8502954a433143f6fdbc7f19ece0636/addons/van_jsx/src/jsx-runtime.js#L36-L39

But now, it should be handled like the other properties:

https://github.com/vanjs-org/van/blob/223c97906ad8f96b669a90282a772b1ac1f9f093/addons/van_jsx/src/createElement.js#L3-L7

https://github.com/vanjs-org/van/blob/223c97906ad8f96b669a90282a772b1ac1f9f093/addons/van_jsx/src/hyper.js#L11-L16

The point is that the style property is not in the props array because of destructuring in the createElement parameters.

As the style parameter is no more used in the current implementation, it should be left in the properties array. It will be correctly handled by the setAttribute function.

damienflament commented 3 months ago

I'm preparing a pull request to fix some issues, including this one.

See https://github.com/damienflament/van/tree/jsx-fixes