Closed ArchanaSharma95 closed 2 years ago
You can not initialize form control in render method without using useRef
because it would reset controls on every re-render. The solution is to use useRef
or define controls outside functional component.
I am facing an issue with React functional component. I have initialized the formgroup but after every renders it reinitializes the form variable. Is this support React functional components and hooks? If yes, please provide some example codes to work with React functional components and Hooks.
Thanks.