title: Pass function as parameter to put onChange of input
body: <p>How do I pass the name of a function and variable as a parameter and then define it in an input in javascript?</p>
  <p>My component:
  <a href="https://i.stack.imgur.com/AZT9E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AZT9E.png" alt="" /></a></p>
  <p>{this.gerarInput(&quot;username&quot;,&quot;text&quot;,&quot;Nome&quot;,&quot;this.handleChange()&quot;,&quot;this.state.username&quot;)}</p>
  <p>My Function:</p>
  <p><a href="https://i.stack.imgur.com/45ycZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/45ycZ.png" alt="" /></a></p>
  <p>gerarInput(nome,tipo,fundo,onChange,valor){
  return(
  &lt;&gt;
  
  
  
  
  
  
  
  
  &lt;/&gt;
  )
  };</p>
  <p>My Error</p>
  <p><a href="https://i.stack.imgur.com/6M0Ik.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6M0Ik.png" alt="" /></a></p>