Javascript语法null:?{}
榜样 我不知道它是什么意思Javascript语法null:?{},javascript,reactjs,react-native,flowtype,Javascript,Reactjs,React Native,Flowtype,榜样 我不知道它是什么意思circle:(null:?{setNativeProps(props:Object):void}) 谢谢你的建议。这是打字,你可以在这里看到更多细节 类型转换对于检查假设和帮助Flow推断您想要的类型特别有用。以下是一些例子: (x: number) // Make Flow check that x is a number (0: ?number) // Tells Flow that this expression is actually nullabl
circle:(null:?{setNativeProps(props:Object):void})
谢谢你的建议。这是打字,你可以在这里看到更多细节
类型转换对于检查假设和帮助Flow推断您想要的类型特别有用。以下是一些例子:
(x: number) // Make Flow check that x is a number
(0: ?number) // Tells Flow that this expression is actually nullable.
(null: ?number) // Tells Flow that this expression is a nullable number.
因此
circle:(null:?{setNativeProps(props:Object):void})
是指circle
属性是一个可为null的对象,它有一个setNativeProps
方法,默认值是null
,可能需要引用文章中最重要的部分。
(x: number) // Make Flow check that x is a number
(0: ?number) // Tells Flow that this expression is actually nullable.
(null: ?number) // Tells Flow that this expression is a nullable number.