如何使vs代码自动完成React组件的prop类型? [英] How to make vs code autocomplete React component's prop types?
本文介绍了如何使vs代码自动完成React组件的prop类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在JSX标记中使用组件时,如何使VS Code自动完成React组件的prop类型?
How to make VS Code autocomplete React component's prop types while using the component in JSX markup?
P.S .:我使用的是JS,而不是TS.
P.S.: I'm using JS, not TS.
推荐答案
还有使用@params定义的选项:
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) {...}
这篇关于如何使vs代码自动完成React组件的prop类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文