Search⌘ K

Imperative React

Explore the evolution of imperative programming in React by understanding how refs have changed from string refs and callback refs to createRef and useRef hooks. This lesson helps you learn how to manage refs in modern function components and compare legacy approaches to the current best practices with React hooks.

We'll cover the following...

In a React function component, React’s useRef Hook is used mostly for imperative programming. Throughout React’s history, the ref and its usage had a few versions:

  • String Refs (deprecated)
  • Callback Refs
  • createRef Refs
...