I have an issue where IntelliJ (ultimate) auto inserts double quotes in JSX. Take the following example. Starting with a div
,
<div className />
once I type =
, IntelliJ updates the div to the following:
<div className="" />
Now, that would have been nice if I was about to supply a string and I wanted to use double quotes, but I always prefer single quotes and I mostly need to reference variables like this.props
. Is there a way to tell IntelliJ to stop autocompleting JSX syntax? I would like to disable just this feature and keep the other features, like auto-updating tag names while I edit one end of the tag, but this is annoying enough that I would accept disabling it all.
To turn off autocomplete on an input field in React, set the autoComplete prop to off or new-password , e.g. <input autoComplete="off" /> . When autoComplete is set to off , the browser is not permitted to automatically enter a value for the field.
JSX allows us to write HTML elements in JavaScript and place them in the DOM without any createElement() and/or appendChild() methods. JSX converts HTML tags into react elements. You are not required to use JSX, but JSX makes it easier to write React applications.
JSX stands for JavaScript syntax extension. It is a JavaScript extension that allows us to describe React's object tree using a syntax that resembles that of an HTML template. It is just an XML-like extension that allows us to write JavaScript that looks like markup and have it returned from a component.
I'm using IntelliJ IDEA 2016.1.2. In this version, you can disable this behavior in
Editor -> General -> Smart Keys
under Settings
. Uncheck the box for Add quotes for attribute value...
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With