Skip to content

Commit

Permalink
Merge pull request #99 from mj-studio-library/develop
Browse files Browse the repository at this point in the history
fix: convert StyleSheet.compose => array literal
  • Loading branch information
mym0404 authored May 2, 2024
2 parents 1b189c9 + b8090f5 commit 1b481f8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/core/src/hook/useSx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,13 @@ export const useSx = <S extends ViewStyle = ViewStyle, P extends Props = Props>(
const composedStyle = !mergedSxStyle
? props?.style
: props?.style
? StyleSheet.compose(mergedSxStyle, props.style)
? [mergedSxStyle, props.style]
: mergedSxStyle;

if (is.function(transform)) {
const transformedSx = transform(StyleSheet.flatten(composedStyle));

const ret = StyleSheet.compose(
composedStyle,
propsToThemedStyle({ theme, sx: transformedSx, styleType }),
);
const ret = [composedStyle, propsToThemedStyle({ theme, sx: transformedSx, styleType })];

if (cache) {
return getCachedStyle(ret);
Expand Down

0 comments on commit 1b481f8

Please sign in to comment.