diff --git a/.gitignore b/.gitignore index 8450ac6..31e5125 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ node_modules/ # WebStorm .idea + +# Mac OS X folder attributes file +.DS_Store \ No newline at end of file diff --git a/src/connectStyle.js b/src/connectStyle.js index 39bf625..33808bb 100644 --- a/src/connectStyle.js +++ b/src/connectStyle.js @@ -49,6 +49,13 @@ export default (componentStyleName, componentStyle = {}, mapPropsToStyleNames, o return WrappedComponent.displayName || WrappedComponent.name || 'Component'; } + function getBaseComponent(WrappedComponent) { + if (WrappedComponent.BaseComponent) { + return WrappedComponent.BaseComponent; + } + return WrappedComponent; + } + return function wrapWithStyledComponent(WrappedComponent) { const componentDisplayName = getComponentDisplayName(WrappedComponent); @@ -99,6 +106,7 @@ export default (componentStyleName, componentStyle = {}, mapPropsToStyleNames, o static displayName = `Styled(${componentDisplayName})`; static WrappedComponent = WrappedComponent; + static BaseComponent = getBaseComponent(WrappedComponent); constructor(props, context) { super(props, context);