Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 01a5e63

Browse files
committed
-reverted factories
1 parent 38a3623 commit 01a5e63

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

packages/react/src/utils/factories.ts

+5-12
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
ShorthandRenderFunction,
1010
ShorthandRenderer,
1111
} from '../types'
12-
// import { mergeStyles } from './mergeThemes'
12+
import { mergeStyles } from './mergeThemes'
1313

1414
type HTMLTag = 'iframe' | 'img' | 'input'
1515
type ShorthandProp = 'children' | 'src' | 'type'
@@ -250,17 +250,10 @@ function createShorthandFromValue<P>({
250250

251251
// Merge styles
252252
if (defaultProps.styles || overrideProps.styles || usersProps.styles) {
253-
// As long as we allow the styles prop to be a function, I don't see how we can cache it, as the stirng of the function will always be mergeStyles..
254-
// ;(props as any).styles = mergeStyles(
255-
// defaultProps.styles,
256-
// usersProps.styles,
257-
// overrideProps.styles,
258-
// )
259-
// Just for hacking, relaying that it will always be an object, so we can cache...
260-
;(props as any).styles = _.merge(
261-
defaultProps.styles || {},
262-
usersProps.styles || {},
263-
overrideProps.styles || {},
253+
;(props as any).styles = mergeStyles(
254+
defaultProps.styles,
255+
usersProps.styles,
256+
overrideProps.styles,
264257
)
265258
}
266259

0 commit comments

Comments
 (0)