Skip to content

Commit

Permalink
Merge branch 'release/0.8.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Adamic committed Sep 29, 2016
2 parents 8a2e8ff + e7c199c commit 882d199
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shoutem/theme",
"version": "0.8.6",
"version": "0.8.7",
"main": "index.js",
"description": "Style your components in one place.",
"dependencies": {
Expand Down
19 changes: 18 additions & 1 deletion src/connectStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export default (componentStyleName, componentStyle = {}, mapPropsToStyleNames, o
super(props, context);
const styleNames = this.resolveStyleNames(props);
const resolvedStyle = this.resolveStyle(context, props, styleNames);
this.setWrappedInstance = this.setWrappedInstance.bind(this);
this.state = {
style: resolvedStyle.componentStyle,
childrenStyle: resolvedStyle.childrenStyle,
Expand Down Expand Up @@ -184,9 +185,25 @@ export default (componentStyleName, componentStyle = {}, mapPropsToStyleNames, o
);
}

setNativeProps(nativeProps) {
if (this.wrappedInstance.setNativeProps) {
this.wrappedInstance.setNativeProps(nativeProps);
}
}

setWrappedInstance(component) {
this.wrappedInstance = component;
}

render() {
const { addedProps, style } = this.state;
return <WrappedComponent {...this.props} {...addedProps} style={style} />;
return (
<WrappedComponent
{...this.props}
{...addedProps}
style={style}
ref={this.setWrappedInstance}
/>);
}
}

Expand Down

0 comments on commit 882d199

Please sign in to comment.