DEV Community

Why imperative code using refs should be avoided?

Michael De Abreu on April 18, 2020

Ok. I really thought the title would be self-explanatory, but it seems it isn't. I have a really strong Angular background and to access a child re...
Collapse
 
miccoh1994 profile image
miccoh1994

If you ever found out why I would like to know! useImperativeHandle is a great way for me to seperate, for example, and image drag and drop uploader from the rest of a form twithout having a very messy/verbose form component.

Collapse
 
michaeljota profile image
Michael De Abreu

For what is worth, I've been using that since I post this and I'd noticed no performance issues. It is a small app mostly to show server data, and this is mostly used to control modals.