Is there any substitute or work around for achieving the work of template reference variables of Angular in React?
In Angular, a template reference variable is often a reference to a DOM element within a template. You declare a reference variable by using the hash symbol (#).
For Example, the #firstNameInput declares a firstNameInput variable on an <input> element.
<input type="text" #firstNameInput>
<input type="text" #lastNameInput>
After that you can access the variable anywhere inside the template. For example, I pass the variable as an parameter on an event.
<button (click)="show(lastNameInput)">Show</button>
show(lastName){
console.log(lastName.value);
}
thinking in react- button and inputs are children (components) in one component ('template'). input changes are stored in parent state (handler passed as prop); button calls handler defined in parent, too. If you need more shared values/state then use redux