Recap of React Refs Basics
Before we dive right into handling Refs, we should recap some basics regarding Refs and React in general. We will be refreshing our memory on the following topics:
- Native versus custom React components
- Encapsulation via props
This will support us in grasping the usage of Refs as a whole. Furthermore, this will help us in utilizing the knowledge acquired to solve problems related to DOM manipulations efficiently.
Native versus Custom React Components
As you might recall, there are two different types of JSX tags that we frequently write. These are the custom components that we entirely implement ourselves; for example, a specialized input field that has custom properties and is composed of other components. As a standard convention, we represent them as a capitalized JSX variable, as shown in the following code snippet:
// JSX custom Components <MyCustomInput /> <SpecialButton />
The other type of components...