Skip to content

Commit

Permalink
feat: Improve web support with StyleSheet when creating styles
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriazevedo11 committed Oct 16, 2021
1 parent 6b88006 commit 99be881
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/composeRestyleFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {StyleSheet} from 'react-native';

import {
RestyleFunctionContainer,
BaseTheme,
Expand Down Expand Up @@ -44,9 +46,11 @@ const composeRestyleFunctions = <
dimensions: Dimensions;
},
): RNStyle => {
return funcs.reduce((acc, func) => {
const style = funcs.reduce((acc, func) => {
return Object.assign(acc, func(props, {theme, dimensions}));
}, {});
const {styleSheet} = StyleSheet.create({styleSheet: style});
return styleSheet;
};
return {
buildStyle,
Expand Down

0 comments on commit 99be881

Please sign in to comment.