title: How to get dynamic ref on React
body: <p>I have an element with this ref</p>
  
  <pre><code>ref={`inner-player${this.props.position}`}
  </code></pre>
  
  <p>and in a function I need to work with that ref doing something like this</p>
  
  <p><code>const chipBetImage = this.refs.inner-player${this.props.position};</code></p>
  
  <p>but I am getting an error</p>
  
  <pre><code>./app/components/ui/PlayerSlot/index.js
  Module build failed: SyntaxError: /home/marcelo/Documents/Projects/application-playerinterface/app/components/ui/PlayerSlot/index.js: Unexpected token (150:50)
    148 |       this.props.addMoney({position : this.props.position, currentBet : this.props.currentBet});
    149 |     } else {
  &gt; 150 |       const chipBetImage = this.refs.inner-player${this.props.position};
        |                                                   ^
    151 |       chipBetImage.classList.add('animated', 'pulse');
  </code></pre>
  
  <p>so, which is the way to do this ?</p>