title: How to extract a const that depends on a map?
body: <p>I have animations in my component that follow the same style, like this:</p>
  <pre><code>{actions.map((action, i) =&gt; (
      &lt;Component style={{ animation: `fade-animation 12s linear ${i * 3}s infinite` }}&gt;{action}&lt;/Component&gt;
  ))}
  
  {figures.map((figure, i) =&gt; (
      &lt;Component style={{ animation: `fade-animation 12s linear ${i * 3}s infinite` }}&gt;{figure}&lt;/Component&gt;
  ))}
  </code></pre>
  <p>The value <code>fade-animation 12s linear ${i * 3}s infinite</code> it's being repeated in multiple places.</p>
  <p><strong>How can I extract this into a const?</strong></p>
  <p>I tried:</p>
  <pre><code>const fadeAnimation = `fade-animation 12s linear ${i * 3}s infinite`;
  </code></pre>
  <p>But as the i depends on the map, it causes an error.</p>
  <p>Can I extract this even with the <code>i</code>?</p>
  <p>Thanks!!</p>