Using React Refs in Typescript
Sometimes it is necessary to use an imperative programming model and access an underlying DOM element. Whatever the reason this can be accomplished using React refs. This guide will show how to use strongly typed refs using Typescript. We will see how to use refs from functional components, using the hooks API, from class components in version 16.3 and above, from class components in versions prior to 16.3 and forwarding refs to other components.