atom-react icon indicating copy to clipboard operation
atom-react copied to clipboard

JSX not autocompleting

Open scottbarrow opened this issue 8 years ago • 28 comments

  • Create a .js file
  • Ensure grammer selected is Javascript(JSX)
  • Create a React class
  • Enter cursor into render function
  • JSX keywords do not autocomplete or appear in snippets

Can anyone tell me if this is expected behaviour? I would assume JSX/HTML snippets to appear here?

scottbarrow avatar Mar 20 '16 21:03 scottbarrow

same problem and when I filter my packages I found this package schermata 2016-03-21 alle 11 36 44

Randagio13 avatar Mar 21 '16 10:03 Randagio13

Also saw that package installed.

On Mar 21, 2016, 3:37 AM, at 3:37 AM, Alessandro Casazza [email protected] wrote:

same problem and when I filter my packages I found this package schermata 2016-03-21 alle 11 36
44


You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/orktes/atom-react/issues/151#issuecomment-199220075

scottbarrow avatar Mar 21 '16 14:03 scottbarrow

I'm also seeing that package installed.

rayhatfield avatar Mar 22 '16 22:03 rayhatfield

A resolution was removing the React package from ~/.atom/.apm and reinstalling with apm install react. This installed the correct package and the grammars. However, the issue remains that JSX is not autocompleting within a react component. I'm not sure if that is not a feature of this package?

scottbarrow avatar Mar 22 '16 22:03 scottbarrow

Why it is installing facebook/react instead of plugin?

arajpraju avatar Mar 23 '16 09:03 arajpraju

Same problem. Even if removed the '~/.atom/.apm/react' and reinstall with 'apm install react'. Still installed the reactjs not the atom-react.

mqli avatar Mar 24 '16 03:03 mqli

try removing ~/.atom/packages/react and ~/.atom/.apm/react then perform apm install react

scottbarrow avatar Mar 24 '16 03:03 scottbarrow

thx @scottbarrow, It work. Before I remove the ~/.atom/.apm/react, I found out that since the 0.14.2 version, the package.json is the package.json of the reactjs, so the apm insall it instead, haven't finger it out why yet.

mqli avatar Mar 24 '16 03:03 mqli

@scottbarrow your solution did work for me as well! :+1:

seoyoochan avatar Mar 27 '16 05:03 seoyoochan

Unfortunately, this solution did not work for me. I still don't have autocompletion working. :-1:

linker-err0r avatar Apr 06 '16 15:04 linker-err0r

@deathgaze Download the zip file directly from github and extract into ~/.atom/packages/ and do an npm install inside the extracted folder.

arajpraju avatar Apr 06 '16 15:04 arajpraju

@arajpraju I did as you told me and hit the Download ZIP button from the Github Repo. I extracted it into ~/.atom/packages/, shutdown Atom, rm -rf react, mv atom-react-master react, cd react, npm install and started Atom. Unfortunately, it did not improve the situation. :(

linker-err0r avatar Apr 06 '16 17:04 linker-err0r

@deathgaze you need to completely restart the process of atom.

seoyoochan avatar Apr 06 '16 17:04 seoyoochan

@seoyoochan I did. Using Cmd-Q. Is there another way to do it?

linker-err0r avatar Apr 06 '16 17:04 linker-err0r

@deathgaze can you try the solution of scottbarrow?

seoyoochan avatar Apr 07 '16 02:04 seoyoochan

@seoyoochan yes, I tried @scottbarrow 's solution first. No dice. :(

linker-err0r avatar Apr 07 '16 02:04 linker-err0r

Is there maybe some other component that autocomplete depends on that I might try fiddling with?

linker-err0r avatar Apr 07 '16 02:04 linker-err0r

Same problem with me, cannot run autocomplete for html in render method. Please let me know how can solve it. Thanks,

tungphuong avatar Oct 20 '16 04:10 tungphuong

@jackyphuong try updating to the latest version. If it didn't work remove the plugin and install it again.

arajparaj avatar Oct 20 '16 05:10 arajparaj

@arajparaj, i removed plugin and install it again, then restart atom but cannot use autocomplete. I can use auto close, ... Besides, i just install atom and plugin yesterday. So, i think it is the lastest version. Could u please let me know how can check or another way? Thanks

tungphuong avatar Oct 20 '16 14:10 tungphuong

@jackyphuong I just solved and saw I had two conflicting packages - the React package (detects and enables Javascript (JSX) grammar for the file, and Language-Javascript-JSX (detects and enables Javascript with JSX grammar for the file.

I did the following to resolve:

  1. uninstall the Language-Javascript-JSX package if it is installed.
  2. rm -rf ~/.atom/packages/react
  3. rm -rf ~/.atom/.apm/react
  4. apm install react
  5. restart atom
  6. ensure that Javascript (JSX) is the grammar selected for the file.

alteredtastes avatar Jun 25 '17 21:06 alteredtastes

Tried above solution and still no avail. All community packages turned off, installed with apm, divs still don't auto close in render block. JSX is the set grammar. It's just type 'div', hit tab and things will close, right?

Atom 1.18.10 react 0.16.2

eggsandbeer avatar Jul 15 '17 22:07 eggsandbeer

i had same problem, managed to get auto closing to work with render method by 1) quitting atom completely. 2) run 'apm uninstall react'. 3) run 'apm install react'... Then re open atom and seemed to be working fine for me. You also need to change the file type down the bottom right to JavaScript(JSX)

tyrong avatar Jul 28 '17 07:07 tyrong

I report having this problem as well and none of the above solutions work. Atom 1.18.0

eternauta1337 avatar Aug 07 '17 17:08 eternauta1337

I'm encountering the same problem as well. I can't auto-complete/get the closing tags feature to work. Currently running:

Atom    : 1.24.0
Electron: 1.6.16
Chrome  : 56.0.2924.87
Node    : 7.4.0

DanielTamkin avatar Feb 23 '18 02:02 DanielTamkin

I still have the same problem too. Autocomplete and tag completion both not working. Tried everything mentioned above. Currently running:

Atom    : 1.25.1
Electron: 1.7.11
Chrome  : 58.0.3029.110
Node    : 7.9.0

Windows 10.0.16299.

---- UPDATE ---- I never got this to work, so I ended up trying this tweak on Emmet and it's perfect for me :+1: :smile:

https://gist.github.com/mxstbr/361ddb22057f0a01762240be209321f0

CodeWithOz avatar Apr 13 '18 06:04 CodeWithOz

@eggsandbeer actually not by hitting tab, but it will autoclose itself after you write <div>. @alteredtastes solution work for me perfectly.

  1. uninstall the Language-Javascript-JSX package if it is installed.
  2. rm -rf ~/.atom/packages/react
  3. rm -rf ~/.atom/.apm/react
  4. apm install react
  5. restart atom
  6. ensure that Javascript (JSX) is the grammar selected for the file.

fadlykayo avatar Sep 30 '18 09:09 fadlykayo

Any solution for this problem. I'm getting totally crazy trying to solve the JSX html autocomplete on Atom

Angelhpascual avatar May 23 '20 17:05 Angelhpascual