title: How to add <script> tag using ReactJS?
body: <p>I need to declare a javascript function as described below:</p>
  
  <pre><code>render: function() {
    return (
            &lt;div&gt;
              &lt;SomeReactClass somefunction="myFunction"&gt;
              &lt;script&gt;
                function myFunction(index, row) {
                  return index;                       &lt;&lt;&lt;&lt; error in this line 
                }
              &lt;/script&gt;
            &lt;/div&gt;
            );
  }
  </code></pre>
  
  <p>But, it does not compile: "Parse Error: Line 113: Unexpected token return" </p>
  
  <p>How can I add  tag using ReactJS?</p>
  
  <hr>
  
  <h2>UPDATE</h2>
  
  <p>I'm trying to use <a href="http://issues.wenzhixin.net.cn/bootstrap-table/#options/detail-view.html" rel="noreferrer">bootstrap-table detail view</a>. The function is passed as parameter to the grid and it is used to render the row's detail. Also, see the <a href="https://github.com/wenzhixin/bootstrap-table-examples/blob/master/options/detail-view.html" rel="noreferrer">example's source code</a> for a better understanding.</p>
  
  <p>When I try the way you're saying, it compiles, but does not work at all:</p>
  
  <p>This is how it looks like (in example above):</p>
  
  <p><img src="https://i.stack.imgur.com/H50SC.png" alt="enter image description here"></p>
  
  <p>This is what I'm getting with <code>&lt;SomeReactClass somefunction={myFunction}&gt;</code></p>
  
  <p><img src="https://i.stack.imgur.com/mL3j0.png" alt="enter image description here"></p>