0

I have two components, one being Parent and other one Child, both as functional components. In the parent component I have a submit button, which when invoked will call a function defined in the Child functional component (e.g. submitHandler()). By using the forwardRef() in child component I am unable to access the submitHandler() of child functional component. Any idea/help regarding how can i tackle this?

Dennis Kozevnikoff
  • 2,078
  • 3
  • 19
  • 29

1 Answers1

0

You are looking for useImperativeHandle hook.

for more info have a look at this post Call child method from parent

M. Sihan
  • 216
  • 2
  • 3