You may have a custom text input class component that exposes some methods which you can call via holding a ref to it. We'll show you how to do the same thing with a function component with hooks.
ReadBy depending on an interface instead of an implementation we can make our components more flexible and more testable by injecting different dependencies when testing.
Read