Merge pull request #2898 from vepor/css-without-interpolations

Unnecessary flattening and interleave of css without interpolations
This commit is contained in:
Max Stoiber
2019-12-02 10:34:44 +01:00
committed by GitHub

View File

@@ -12,6 +12,11 @@ export default function css(styles: Styles, ...interpolations: Array<Interpolati
return flatten(interleave(EMPTY_ARRAY, [styles, ...interpolations]));
}
if(interpolations.length === 0 && styles.length === 1 && typeof styles[0] === "string") {
// $FlowFixMe
return styles;
}
// $FlowFixMe
return flatten(interleave(styles, interpolations));
}