React was designed with the mentality that parent components interact with their children by sending them props. This works in most scenarios, but not all.
Changing a prop in a child component will make it render in a different way, but it doesn’t allow us to tell the component to do something (trigger an event in a component). If we want to trigger an event in a component, we need to get a reference to it. Unfortunately, it’s not always easy to do this.
The React documentation warns against the use of refs and suggests the use of props instead:
For example, instead of exposing open() and close() methods on a Dialog component, pass an isOpen prop to it.