choojs / hyperx

🏷 - tagged template string virtual dom builder
BSD 2-Clause "Simplified" License
1.01k stars 48 forks source link

Feature: adding spread like operator #46

Closed SilentCicero closed 7 years ago

SilentCicero commented 7 years ago

In JSX you can use spread naturally <MyReactComponent ...props>. I think for hyperx we should support a simple spread operator: <MyHyperxComponent ...${props}>.

I added this already by overriding my createElement function for yo-yo, works great and is super useful. A great little feature. The notation is different enough that it shouldn't effect existing hyperx components, but is super useful for building higher level components that are essentially bypasses.

The only other way to do this is by overriding the createElement methods of other libs like yo-yo and bel. Not very nice really.

Love hyperx, best.

jorgebucaran commented 7 years ago

This would be most useful to have.

JamesKyburz commented 7 years ago

We already have this feature, no spread is needed though.

https://github.com/substack/hyperx/blob/master/test/key.js#L46

jorgebucaran commented 7 years ago

Great to know! Thanks @JamesKyburz, I didn't know.

SilentCicero commented 7 years ago

Wow, awesome thanks @JamesKyburz maybe we should add this to the ReadMe or make it more clear in the docs.