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() {
|
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…
Reference in New Issue