ReactClass<*> 是什么意思?
What does ReactClass<*> mean?
我在 code for React-Navigation 中看到 ReactClass<*>
。我有两个问题:
- 为什么
ReactClass
不需要在文件顶部导入?它是 React Native 中的某种全局常量吗?
ReactClass<*>
是什么意思?
它是一个 存在类型 in Flow 的 React 组件。
简而言之,他们说期望 tabBarComponent
可能存在也可能不存在(注意 tabBarComponent?
末尾的问号,并且它将是一个 React 组件 class,带有 flow 将推断的类型的参数。
Flow 是制作 JavaScript strongly typed 的工具。
我在 code for React-Navigation 中看到 ReactClass<*>
。我有两个问题:
- 为什么
ReactClass
不需要在文件顶部导入?它是 React Native 中的某种全局常量吗? ReactClass<*>
是什么意思?
它是一个 存在类型 in Flow 的 React 组件。
简而言之,他们说期望 tabBarComponent
可能存在也可能不存在(注意 tabBarComponent?
末尾的问号,并且它将是一个 React 组件 class,带有 flow 将推断的类型的参数。
Flow 是制作 JavaScript strongly typed 的工具。