Skip to content

Commit

Permalink
refactor: fix splitStyles for Expo Snack (callstack#3779)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitarNestorov committed Mar 23, 2023
1 parent d88ff20 commit 3c375a0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/utils/splitStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function splitStyles<Tuple extends FiltersArray>(

// `Object.entries` will be used to iterate over the styles and `Object.fromEntries` will be called before returning
// Entries which match the given filters will be temporarily stored in `newStyles`
const newStyles = filters.map(returnEmptyArray<Entry>);
const newStyles = filters.map(() => [] as Entry[]);

// Entries which match no filter
const rest: Entry[] = [];
Expand Down Expand Up @@ -58,7 +58,3 @@ export function splitStyles<Tuple extends FiltersArray>(
...MappedTuple<Tuple>
];
}

function returnEmptyArray<SomeArray>() {
return [] as SomeArray[];
}

0 comments on commit 3c375a0

Please sign in to comment.