I am currently trying to get the child component functions using the ref
in the following way but it doesn't show any of the details.
class ChildCompent extends React.Component {
constructor(props){
super(props);
}
_function1 =()=>{
/* ...... */
}
_function1 =()=>{
/* ...... */
}
render (){
return (
<div>
ChildComponent
</div>
)
}
}
let ComposedChild = compose(
/* --- graphql query */
)(ChildComponent);
class ParentComponent extends React.Component {
constructor(props){
super(props);
}
_onClick = ()=>{
console.log(this.refs.childComponent)
// doesn't show the _function1 and _function2
}
render (){
return (
<div onClick={this._onClick}>
<div>Testing</div>
<ChildComponent ref="childComponent"/>
</div>
)
}
}