Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I disable syntax autocomplete of JSX properties?

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.

like image 870
Anthony Naddeo Avatar asked Jun 04 '16 23:06

Anthony Naddeo


People also ask

How do I turn off input autoComplete React?

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.

What are JSX elements?

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.

How React JSX works?

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.


1 Answers

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....

like image 116
ck1 Avatar answered Sep 26 '22 02:09

ck1