title: Alternative for document.querySelector in react js
body: <p>I've red many articles about using <code>useRef</code> in react js. According to <a href="https://reactjs.org/docs/refs-and-the-dom.html" rel="noreferrer">react js documentation</a>, <code>Refs provide a way to access DOM nodes or React elements created in the render method.</code>. <br>
  From all of documentation, i understood that, if you want to access a dom element, you have to add the ref like this: 
  <br>
  <code>&lt;div ref={myRef}</code>, and after that easy to access it.<br>
  I understood that <code>useRef</code> is used when we have access to the html markup.<br></p>
  
  <p><strong>Question</strong>: How to access a css selector (<code>.class, #id</code>), when my html is generated by a library, like 
  AntD or something else?
  <br>
  How to access this selector if i can't use <code>document.querySelector</code> according to react documentation? EX: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code> document.querySelector('my selector').style.color = 'yellow';</code></pre>
  </div>
  </div>
  
  <br>
  Which is the alternative for the last code snippet in react js?</p>
  
  <p><br>
  <strong>NOTE</strong>: I don't want to change the styles with css, but i need to change it according to some js logic.</p>