title: Hidden Input/Textarea value onChange setState in React - without user typing inputs
body: <p>I need to <strong>trigger a function</strong> when the value of <strong>Hidden input</strong>/textArea/TextField changing in <strong>React</strong>. Not when the user enter values. When dynamically changing the hidden input value trigger a function.</p>
  <pre><code>import TextField from &quot;@material-ui/core/TextField&quot;;
  
  class RowComponent extends Component {
    constructor(props) {
      super(props);
      this.state = {
        xx: &quot;&quot;,
        salary: 0,
      };
    }
  
    handleChange = (event) =&gt; {
      this.setState({
        xx: event.target.value,
      });
    };
  
    render() {
      const {
        member: { salary },
      } = this.props;
  
      console.log(this.state.xx);
  
      return (
        &lt;TextField
          name=&quot;HiddenField&quot;
          type=&quot;hidden&quot;
          value={this.state.salary !== 0 ? this.state.salary : salary}
          onChange={this.handleChange}
        /&gt;
      );
    }
  }
  </code></pre>