I am trying to code a React Native application in Visual Studio Code. But I found that the hint for React Native for Styles element didn’t show when I code. I already installed:
JavaScript
x
4
1
ES7+ React/Redux/React-Native snippets
2
React Native Tools
3
Simple React Snippets
4
Here is the example when I type flex. It is supposed to show a list of styles element related to flex but it didn’t. Is anyone know how to enable it? Here is a screenshot:
Here is my settings.json file
JavaScript
1
47
47
1
{
2
"java.home": "C:\Program Files\Java\jdk1.8.0_211",
3
"java.help.firstView": "gettingStarted",
4
"editor.suggestSelection": "first",
5
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
6
"python.languageServer": "Default",
7
"workbench.editorAssociations": {
8
"*.ipynb": "jupyter-notebook"
9
},
10
"notebook.cellToolbarLocation": {
11
"default": "right",
12
"jupyter-notebook": "left"
13
},
14
"php.suggest.basic": false,
15
"php.validate.enable": false,
16
"emmet.excludeLanguages": [
17
"markdown",
18
"php"
19
],
20
"php.validate.executablePath": "C:/xampp/php/php.exe",
21
"php.debug.executablePath": "C:/xampp/php/php.exe",
22
"php.executablePath": "C:/xampp/php/php.exe",
23
"vs-color-picker.autoLaunch": true,
24
"liveServer.settings.CustomBrowser": "chrome",
25
"liveServer.settings.useLocalIp": true,
26
"liveServer.settings.port": 0,
27
"workbench.colorTheme": "Visual Studio Dark",
28
"git.confirmSync": false,
29
"[javascript]": {
30
"editor.defaultFormatter": "esbenp.prettier-vscode"
31
},
32
"workbench.iconTheme": "material-icon-theme",
33
"editor.formatOnPaste": true,
34
"editor.formatOnType": true,
35
"editor.formatOnSave": true,
36
"[vue]": {
37
"editor.defaultFormatter": "esbenp.prettier-vscode"
38
},
39
"[javascriptreact]": {
40
"editor.defaultFormatter": "esbenp.prettier-vscode",
41
},
42
"emmet.includeLanguages": {
43
"javascript": "javascriptreact",
44
"typescript": "typescriptreact",
45
},
46
}
47
Advertisement
Answer
I solved this problem by following this post:
VsCode Intellisense react native not working
Which is installing this npm package into your project. By entering this command inside the terminal window of your VS Code:
npm install --save @types/react-native
Thanks for the help!