Suggestion
π Search Terms
- jsx
- tsx
- shorthand
- properties
β
Viability Checklist
My suggestion meets these guidelines:
β Suggestion
Bun implements JSX shorthand properties, presumably because they are extremely convenient to use, even though they haven't been added to the JSX spec, presumably because that's effectively dead.
π Motivating Example
Example code:
const onClick = console.log;
const vdom = <div {onClick} />;
console.log ( vdom );
Basically {foo} is just a shorthand for foo={foo}. The same way outside of JSX {foo} is a shorthand for {foo: foo}.
π» Use Cases
It's a very natural extension of the syntax, and extremely convenient too, for many components that I personally write about half of the JSX is just redundant and could be deleted if I could use shorthand properties.
As massive of an improvement it is though I can't give up type-checking for it.
Basically the engine I'd like to use supports it already, the code I tend to write screams for this feature, but the JSX spec is abandonware and TS doesn't support it.
Can we please consider adding it and improve the lives of millions of developers? If that's not a strong argument enough can we consider adding this for compatibility with Bun?
I'd be more than happy to submit a PR for this.
//cc @Jarred-Sumner
Suggestion
π Search Terms
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
Bun implements JSX shorthand properties, presumably because they are extremely convenient to use, even though they haven't been added to the JSX spec, presumably because that's effectively dead.
π Motivating Example
Example code:
Basically
{foo}is just a shorthand forfoo={foo}. The same way outside of JSX{foo}is a shorthand for{foo: foo}.π» Use Cases
It's a very natural extension of the syntax, and extremely convenient too, for many components that I personally write about half of the JSX is just redundant and could be deleted if I could use shorthand properties.
As massive of an improvement it is though I can't give up type-checking for it.
Basically the engine I'd like to use supports it already, the code I tend to write screams for this feature, but the JSX spec is abandonware and TS doesn't support it.
Can we please consider adding it and improve the lives of millions of developers? If that's not a strong argument enough can we consider adding this for compatibility with Bun?
I'd be more than happy to submit a PR for this.
//cc @Jarred-Sumner