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?
Asked
Active
Viewed 343 times
0

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

Raunak Tibrewal
- 25
- 1
- 3
-
what you have done so far? show your code / add codesandbox or jsfiddle – bakar_dev Jul 29 '20 at 13:35
1 Answers
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