I have 2 components:
1:Parent 2:Child
I want to pass some data from child to parent. in fact, I have a method in the parent component as following:
mymethod= (message) => {
console.warn(message);
}
in the child component I'm using this:
<Parent ref= { (child) => {this.refs= child; }} />
this.refs.mymethod(message);
but when I run that code, I get this:
Undefined is not an object (evaluating _this.ref.method)