#VSCode Errors on Shorthand React Prop Syntax

1 messages · Page 1 of 1 (latest)

drifting vortex
#

Is there any solution to fix these errors appearing in VSCode when using the neat react prop shorthand? See screenshot
The code works fine and I love this syntax so much, so I'd really like to keep using it if possible!
Thanks in advance 🙂

silk wave
drifting vortex
#

That's right

silk wave
#

Can u tell what u see when u hover on them?

drifting vortex
#

many things :3

silk wave
drifting vortex
#

That would surpress those errors even in valid cases though correct? I still want the errors to show when they're legit, just not here :p

drifting vortex
#

Oh also I'm using VIsual Studio Code, not VS :)

silk wave
#

These errors must be occurring because u must have something wrong in ur code maybe or ur using a buggy extension

drifting vortex
#

I don't think I'm using any extension, should I be?

#

Nothing is wrong with my code though, if i just put the prop names in it all goes away

silk wave
#

Depends on u but i personally code in js, python, go and i do use extensions because they make everything so easy

drifting vortex
#

Because I prefer the shorthand syntax sugar :)

#

Oh, I thought this syntax was a feature of Bun 🤔

ruby wedge
#

Oh sorry, misinformation. It has been discussed here: https://github.com/microsoft/TypeScript/issues/52057

It's a shame they don't want to move it forward. We apparently will have to wait for another major framework to support it so it gets some traction. Or a big YouTuber makes a move on it.

(Most) spec maintainers are hell. Not the first great feature that is an obvious thing that should be supported but one or a few guys are just against changes due to their brains' wiring.

I don't like {x, y, z}. {x} {y} is better for readability and it's easier to implement. With enough effort it would be possible to gather the community to work for it.

GitHub

Suggestion 🔍 Search Terms jsx tsx shorthand properties ✅ Viability Checklist My suggestion meets these guidelines: This wouldn't be a breaking change in existing TypeScript/JavaScript code This...

#

I get the point that TS should only accept it if JSX does, although it could be less radical as it has been in the past and helped the improvement of JS.

But JSX is frozen. No changes there. So we depend on them and they don't move.

drifting vortex