简体   繁体   English

React Native什么是Props类型?

[英]React Native what is type Props?

today I made a new React Native app and noticed something different than the last time I created a native app. 今天我制作了一个新的React Native应用程序并注意到与上次创建本机应用程序时不同的东西。

type Props = {}
export default class App extends Component<Props> {}

What type Props = {}; 什么type Props = {}; is? 是什么? I can't really find anything about it. 我真的找不到任何关于它的东西。

The code is using Flow , and this is how you give the types of the props the component has. 代码使用的是Flow ,这就是你给出组件所具有的道具类型的方式。 This particular component doesn't have any props. 这个特殊的组件没有任何道具。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM