Okay guys this is a continuation of the previous react ref’s article. So here we are gonna learn a new way of making references using ‘React Ref’.
This method involves using a callback technique where the callback receives an instance or an Element as an argument.
In this technique you don’t need to make use of the React.createRef() API.
So this example below would illustrate how this can be done.
See the Pen React- Callback Refs by Samson Amaugo (@Sammy360) on CodePen.
You can leave your questions or contributions in the comment section below.
The next post would cover another part of React Refs where a Ref can be forwarded to other components and giving them control over the node in reference.