title: How to replace parts of a string with React Link component
body: <p>I have a text (random text) like this one: </p>
  
  <pre><code>bla bla bla (name of link)[link] bla bla bla (name of link)[link]
  </code></pre>
  
  <p>I need to replace all of <code>(name of link)[link]</code> with <code>Link</code> React component:</p>
  
  <pre><code>&lt;Link to={link}&gt;name of link&lt;/Link&gt;
  </code></pre>
  
  <p>What I want to see:</p>
  
  <pre><code>bla bla bla &lt;Link to='/testRoute'&gt;Test name&lt;/Link&gt; bla bla bla &lt;Link to='/testRoute'&gt;Test name&lt;/Link&gt;
  </code></pre>
  
  <p><code>(name of link)[link]</code> in the text can be absent, and can meet many times.</p>
  
  <p>How can I replace all matches by  in the text?</p>
  
  <p>Any help would be greatly appreciated.</p>