score:3

Accepted answer

you can use hoiststatic.

class basecomponent {
  dosth(){...}
}

const enhance = compose(...some)

const component = hoiststatics(enhance)(basecomponent)

class app {
  componentdidmount() {
    this.refs.component.dosth()
  }
  render() {
    <component ref="component" />
  }
}

you can find a real example in the test.


Related Query

More Query from same tag