Amy Blankenship
Dec 21, 2023

--

You can't both pass the ref to your useImperativeHandle and to an input (or you can, but only one will populate the ref's current prop). So if you're passing the ref to useImperativeHandle, the ref should be typed to the shape of what you give useImperativeHandle, not HTMLInputElement.

--

--

Amy Blankenship
Amy Blankenship

Written by Amy Blankenship

Full Stack developer at fintech company. I mainly write about React, Javascript, Typescript, and testing.

No responses yet