Skip to content

Commit

Permalink
fix: use Object.assign instead of StyleSheet.flatten because it has t…
Browse files Browse the repository at this point in the history
…o be faster
  • Loading branch information
jaredLunde committed Oct 4, 2021
1 parent 8863a9d commit b701dc4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,9 @@ export function createStyles<
if (typeof style === "function" || typeof style === "string") {
return compileStyles(style, tokens);
} else if (Array.isArray(style)) {
return RN.StyleSheet.flatten(
style.map((s) => compileRecursiveStyles(s as any, tokens))
return Object.assign(
{},
...style.map((s) => compileRecursiveStyles(s as any, tokens))
);
}

Expand Down

0 comments on commit b701dc4

Please sign in to comment.