title: React native pass state/props value to custom <html> page?
body: <p>I need to create a pdf invoice using html in react native. for that i'm using<br />
  <code>'react-native-html-to-pdf'</code>.  Actually pdf is creating successfully. But my concern is i need to pass those values from state to that hardcoded html tag.  So far i have hardcoded some values inside the  tag. however i need to pass my state value instead of that.(<strong>To get clear idea, see the comment inside the code</strong>) is there any way to do that?</p>
  <pre><code>import RNHTMLtoPDF from &quot;react-native-html-to-pdf&quot;;
  
  this.state = {
    Balance: 100,
    Total: 200,
    Amount: 400,
  };
  
  onPressRequestButton = async () =&gt; {
    const html = `&lt;html&gt;
      &lt;head&gt;
          &lt;meta charset=&quot;utf-8&quot;&gt;
          &lt;title&gt;Invoice&lt;/title&gt;
          &lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot;&gt;
          &lt;link rel=&quot;license&quot; href=&quot;https://www.opensource.org/licenses/mit-license/&quot;&gt;
          &lt;script src=&quot;script.js&quot;&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;header&gt;
              &lt;span&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.jonathantneal.com/examples/invoice/logo.png&quot;&gt;&lt;input type=&quot;file&quot; accept=&quot;image/*&quot;&gt;&lt;/span&gt;
          &lt;/header&gt;
          &lt;article&gt;
              &lt;h1&gt;Recipient&lt;/h1&gt;
              &lt;table class=&quot;balance&quot;&gt;
                  &lt;tr&gt;
                      &lt;th&gt;&lt;span contenteditable&gt;Total&lt;/span&gt;&lt;/th&gt;
                      &lt;td&gt;&lt;span data-prefix&gt;$&lt;/span&gt;&lt;span&gt;600.00&lt;/span&gt;&lt;/td&gt; // here i need to set total amount {this.state.amount} is not working at all.
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;th&gt;&lt;span contenteditable&gt;Amount Paid&lt;/span&gt;&lt;/th&gt;
                      &lt;td&gt;&lt;span data-prefix&gt;$&lt;/span&gt;&lt;span contenteditable&gt;600.00&lt;/span&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;th&gt;&lt;span contenteditable&gt;Balance Due&lt;/span&gt;&lt;/th&gt;
                      &lt;td&gt;&lt;span data-prefix&gt;$&lt;/span&gt;&lt;span&gt;600.00&lt;/span&gt;&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
          &lt;/article&gt;
      &lt;/body&gt;
      &lt;/html&gt; `;
  
    let options = {
      html: html,
      fileName: &quot;test&quot;,
      directory: &quot;Documents&quot;,
    };
  
    let file = await RNHTMLtoPDF.convert(options);
    alert(file.filePath);
  };
  </code></pre>