mirror of
https://github.com/zhigang1992/styled-components.git
synced 2026-04-29 01:35:53 +08:00
Merge pull request #2898 from vepor/css-without-interpolations
Unnecessary flattening and interleave of css without interpolations
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user