Support nested feature instance

This commit is contained in:
Chi Vinh Le
2018-03-25 23:01:43 +02:00
parent 7867b0113e
commit 9efa5479a8
@@ -78,7 +78,12 @@ class RTE extends React.Component {
handleRef = ref => (this.ref = ref);
forEachFeature(callback) {
Object.keys(this.featuresRef).map(k => callback(this.featuresRef[k]));
Object.keys(this.featuresRef).map(k => {
const instance = this.featureRef[k].getFeatureInstance
? this.featureRef[k].getFeatureInstance()
: this.featureRef[k];
callback(instance);
});
}
componentWillReceiveProps(props) {