18

Is there an extension for VS Code that makes Auto Import for React Native Components?

For Example:

When I type <View, then it automatically suggest for import { View } from 'react-native';

Khemraj Sharma
  • 57,232
  • 27
  • 203
  • 212

1 Answers1

20

Check out the Auto Import plugin by steoates for VS Code

KyleMit
  • 30,350
  • 66
  • 462
  • 664
Kunal
  • 564
  • 5
  • 12
  • @Khemraj _"Works with TypeScript and TSX"_. So, should work with RN if you're writing TS. – Samuli Hakoniemi Apr 15 '18 at 10:08
  • 2
    It didn't work for me. I can autocomplete/import components from the project and from other libraries, but it doesn't work for the react-native lib components – Maxwell s.c Nov 06 '18 at 22:02
  • 1
    it works for me but each time it imports something, cursor jumps to the bottom of the file making it unusable – Jeremi Jan 01 '19 at 23:12
  • 3
    For me, this one worked https://marketplace.visualstudio.com/items?itemName=NuclleaR.vscode-extension-auto-import. Also, change the **Autoimport: Files To Scan** setting to `**/*.{ts,tsx,js,jsx}` – Maxwell s.c Aug 01 '19 at 23:21
  • @SumitShukla it doesn't work for any import? check if it has conflict with another plugin – Maxwell s.c Sep 24 '19 at 12:00
  • @Maxwells.c which plugin? – Sumit Shukla Sep 24 '19 at 12:51
  • try to disable all your plugins. Then, try to install https://marketplace.visualstudio.com/items?itemName=NuclleaR.vscode-extension-auto-import and change the settings i mentioned above – Maxwell s.c Sep 24 '19 at 20:06