Ref forwarding is a technique for automatically passing a ref through a component to one of its children. React components hide their implementation details, including their rendered output. Other components using FancyButton usually will not need to obtain a ref to the inner button DOM element. This is good because it prevents components from relying on each other’s DOM structure too much.
Ref forwarding is an opt-in feature that lets some components take a ref they receive, and pass it further down (in other words, “forward” it) to a child.
#reactjstutorial #reactjs #reactjsbeginners #jasacadamy