我是新来的反应JS。我正在一个项目上,发现这条线
const { var1, var2 } = this.props;
该组件中的道具是
type PropsType = {
var1: Array<any>,
a: Array<any>,
b: boolean,
c: boolean,
var2: (string) => void,
d: () => void,
e: () => void
};
我很困惑。这是什么意思?
const { var1, var2 } = this.props;
// the same as
// const var1 = this.props.var1;
// const var2 = this.props.var2;
您是否尝试过阅读文档?
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句