mirror of
https://github.com/embarklabs/subspace.git
synced 2025-01-10 22:36:16 +00:00
pass only non observable props to wrapped component
This commit is contained in:
parent
52695e5538
commit
1b662fd574
@ -55,7 +55,15 @@ function observe(WrappedComponent) {
|
||||
}
|
||||
|
||||
render() {
|
||||
return <WrappedComponent {...this.props} {...this.state.observedValues} />;
|
||||
const props = Object.keys(this.props).reduce((accum, curr) => {
|
||||
if(!isObservable(this.props[curr])){
|
||||
accum[curr] = this.props[curr];
|
||||
return accum;
|
||||
}
|
||||
return accum;
|
||||
}, {});
|
||||
|
||||
return <WrappedComponent {...props} {...this.state.observedValues} />;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user