Tanweer
Tanweer

Reputation: 111

VsCode Intellisense react native not working

I am facing the problem. I am not getting intellisense of properties onPress onLongPress, paddingHorizontal, paddingVertial even in import when I type Touch then expected Suggestion will be Touchable, TouchableOpacity etc no any suggestion working in react native in vscode.

Upvotes: 4

Views: 6707

Answers (3)

Usman Hassan
Usman Hassan

Reputation: 51

So i found an easy solution to this. All you have to do is change your language mode from JavaScript to JavaScript React.

But that only fixes the auto complete issue, to also fix the auto import you can install this vs code extension called npm Intellisense by Christian Kohler. Link: https://marketplace.visualstudio.com/items?itemName=christian-kohler.npm-intellisense

Upvotes: 0

Fatih Mehmet Berk
Fatih Mehmet Berk

Reputation: 171

If anyone still look for a solution, here, install this npm package @types/react-native by typing in terminal:

npm install --save @types/react-native

This is where I found the solution

Upvotes: 17

Lajne
Lajne

Reputation: 82

You will need to install an extension in VsCode to get that functionality.

vscode-react-native

To install and use the extension, just follow the steps provided from that github repository.

Happy coding!

Upvotes: -4

Related Questions