Whenever you're ready, walk me through how you'd approach this.
Describe a time you used refs in React and explain why you chose them over alternative approaches.
Discuss the specific purpose of the ref, how its lifecycle and mutation behavior affected your implementation, and which alternatives you considered. Keep the answer focused on React and explain the trade-offs clearly.