-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
Help WantedYou can do thisYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some casesThe current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone
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
Help WantedYou can do thisYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some casesThe current behavior isn't wrong, but it's possible to see that it might be better in some cases