title: React: useState() vs useRef()
body: <p>I’ve gone through the React Docs once.</p>
  
  <p>I’m trying to compare useState() with useRef() in my mind…</p>
  
  <p>Commonalities to both useState() and useRef():</p>
  
  <ul>
  <li>Available in functional components only</li>
  <li>Create static values – value persists between function calls</li>
  <li>Values are mutable</li>
  <li>Are scoped within their function component </li>
  <li>Scope includes other hooks (use’s) within their function component</li>
  </ul>
  
  <p>Differences between useState() and useRef():</p>
  
  <ul>
  <li>useState triggers re-render, useRef does not.</li>
  <li>useRef can reference child elements (via “ref={}”), useState can’t.</li>
  <li>For child DOM elements, ref={} refers to the DOM element itself.</li>
  <li>For child React components, ref={} refers to the child component itself.</li>
  </ul>
  
  <p>…And <a href="https://stackoverflow.com/questions/56455887/react-usestate-or-useref">this previous Stackoverflow question</a> adds:</p>
  
  <ul>
  <li>useState updates it’s value asynchronously, useRef updates synchronously.</li>
  </ul>
  
  <p>So I have 3 questions so far:</p>
  
  <ol>
  <li>Are the above commonalities &amp; differences correct?</li>
  <li>Any other commonalities or differences I should be aware of?</li>
  <li>From the component that creates the reference (useRef+ref={}), can I both get &amp; set values on the child component (yes, it may/may not be wise to do so)? </li>
  </ol>