I was struggling to get
PropType autocompletion working in my WebStorm installation when working on a
codebase that consists of multiple top-level folders:
/ admin/ index.js index.html frontend/ <--- React application resides here. index.js index.html server/ index.php
I went through a number of different solutions trying to get autocompletion working (including installing the
@types/prop-types NPM packages).
However, I found that there was only one solution that ended up working:
The solution is as simple as not excluding the specific packages in your
node_modules directory (WebStorm excludes
node_modules directory by default - which means nothing in these directories are indexed).
Once I included
node_modules/react, autocompetion starting working as I expected it to.