-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Description
π Search Terms
JSX, Preact, autocomplete
π Version & Regression Information
- This changed between versions ______ and _______
- This changed in commit or PR _______
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
- I was unable to test this on prior versions because _______
β― Playground Link
No response
π» Code
const a = <div />
π Actual behavior
const a = <div class={} />
π Expected behavior
const a = <div class="" />
Additional information about the issue
https://x.com/adamwathan/status/1953618165042180388
There is so much to love about Preact but the fact that
cl(tab)
autocompletes toclass={}
instead ofclass=""
is going to be the death of me π«@_developit
any tricks to get string-ish props to default to empty strings instead of curlies?
I assume this is the TypeScript LSP under the hood doing it? I see it with JSX across frameworks. Super annoying
Yeah, it seems to give me the expected completions in React though (i.e.
id=""
instead ofid={}
), think it's theSignalish
type in Preact that's causing it.
Type definition in Preact:
https://github.com/preactjs/preact/blob/f3430e0cff27755cff84373e18387aaafdfc7912/src/jsx.d.ts#L1277
Metadata
Metadata
Assignees
Labels
No labels