score:2

Accepted answer

react docs have a example of this using refs

https://reactjs.org/docs/refs-and-the-dom.html

i’m also wondering the use case of wanting to do this, maybe some context could help with an answer?

score:2

try doing it like this:

import editreview from './partials/editreview'

class venuedetails extends component {
  render() {
    return (
      <div classname="place-review-text">
        <editreview ref={ref => this.child=ref } {...this.props} />
      </div>
    )
  }
}

and call the function in parent component as this.child.oneditclick(param1,param2)

edit1:

if you have to do it with react 15.x itself what you can do it is create the function in parent and pass it as a prop to child


Related Query

More Query from same tag