I was wondering if it were possible to call a child's function inside the parent?
For example, can I use useRef to create a reference to the child and then call the function like that? Or is there another way?
// Parent
const init = () => {
const childRef = useRef();
childRef.current.child();
}
// Child
const init = () => {
function child() {
}
}