File tree Expand file tree Collapse file tree
packages/themed/src/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,11 +41,7 @@ const ThemedComponent = (
4141 children,
4242 } ;
4343
44- return isClassComponent ( WrappedComponent ) ? (
45- < WrappedComponent ref = { forwardedRef } { ...newProps } />
46- ) : (
47- < WrappedComponent { ...newProps } />
48- ) ;
44+ return < WrappedComponent ref = { forwardedRef } { ...newProps } /> ;
4945 }
5046 const { components, ...restTheme } = theme ;
5147 const themedProps =
@@ -64,10 +60,7 @@ const ThemedComponent = (
6460 children,
6561 } ;
6662
67- if ( isClassComponent ( WrappedComponent ) ) {
68- return < WrappedComponent ref = { forwardedRef } { ...newProps } /> ;
69- }
70- return < WrappedComponent { ...newProps } /> ;
63+ return < WrappedComponent ref = { forwardedRef } { ...newProps } /> ;
7164 } }
7265 </ ThemeConsumer >
7366 ) ;
@@ -102,7 +95,7 @@ function withTheme<P = {}, T = {}>(
10295 return hoistNonReactStatics ( React . forwardRef ( Component ) , WrappedComponent ) ;
10396 }
10497
105- return Component ;
98+ return React . forwardRef ( Component ) ;
10699}
107100
108101export default withTheme ;
You can’t perform that action at this time.
0 commit comments