Since the last Visual Studio Code update, I’ve got problems with IntelliSense autocompletion. Generally if I want to set a function as a prop (it’s the most common use case of this problem) then instead of inserting just function name VS Code is adding ={}
brackets. So how to get rid of this:
const func = () => {}
...
<button
onClick={func={}}
/>
and get something like this:
const func = () => {}
...
<button
onClick={func}
/>
To clarify – no new add-ons were installed. It’s happening for js/ts
files when writing in React.
2
Answers
As a workaround, we can set
JSX Attribute Completion Style
tonone
.https://github.com/microsoft/vscode/issues/171609#issuecomment-1387107873
How to fix this
run code
in the settings search barEdit in settings.json
to open thesettings.json
file"javascript.preferences.jsxAttributeCompletionStyle": "none"
line to yoursettings.json
fileWhy we do this:
In the
defaultSettings.json
file there is this code snippet:therefore, the default setting for
jsxAttributeCompletionStyle
isauto
and by setting it to"none"
in yoursettings.json
file you overwrite that default setting.