How to make vs code autocomplete React component's prop types?

Max Prilutskiy picture Max Prilutskiy · Jun 7, 2017 · Viewed 13.2k times · Source

How to make VS Code autocomplete React component's prop types while using the component in JSX markup?

P.S.: I'm using JS, not TS.

Answer

Lukas Bares picture Lukas Bares · Dec 6, 2018

There is also option to use @params definition:

/**
 * 
 * @param {{header: string, subheader: string, imageAlt: string, contentList: Array, orderLink: Object, contentLink: Object}} props 
 */
export default function JumbotronMain(props) {...}

enter image description here