[fix] Improve Flow types of StyleSheet.create

Close #2342
This commit is contained in:
ToyboxZach
2022-07-12 11:40:18 -07:00
committed by Nicolas Gallagher
parent 4a9bea27a8
commit 32a4bf8e51
+1 -1
View File
@@ -67,7 +67,7 @@ const absoluteFill = create({ x: { ...absoluteFillObject } }).x;
/**
* create
*/
function create(styles: Object): {| [key: string]: { [key: string]: any } |} {
function create<T: Object>(styles: T): $ReadOnly<T> {
Object.keys(styles).forEach((key) => {
const styleObj = styles[key];
// Only compile at runtime if the style is not already compiled