【发布时间】:2021-12-29 17:46:57
【问题描述】:
这里是创建方法的代码。
create<+S: ____Styles_Internal>(obj: S): $ReadOnly<S> {
// TODO: This should return S as the return type. But first,
// we need to codemod all the callsites that are typing this
// return value as a number (even though it was opaque).
if (__DEV__) {
for (const key in obj) {
if (obj[key]) {
Object.freeze(obj[key]);
}
}
}
return obj;
},
这个函数是如何工作的,
【问题讨论】:
-
+是variance sigil 中的Flow Types
标签: reactjs react-native flowtype