Ref
Refs are a way of getting access to underlying DOM elements in our JSX. While it is true one could just assign an element to a variable, it is more optimal to leave components in the flow of JSX. Refs are assigned at render time but before the elements are connected to the DOM. They come in 2 flavors.
1 2 3 4 5 6 7 8 9 10 |
|
Refs can also be used on Components. They still need to be attached on the other side.
1 2 3 4 5 6 7 8 9 |
|