title: Adding state variable values in react's input tag
body: <pre><code>class Filter extends React.Component {
     constructor(props) {
        super(props);
        this.state = {
         placeholder: true,
         variableValue: '',
        }
     }
    render() {
      return (
       &lt;input placeholder={this.state.placeholder ? "select filter" : this.state.variableValue} /&gt;
    )
   }}
  </code></pre>
  
  <p>Now whenever variable input comes in the state from some function defined in another place. I want to change the placeholder value if the variable has some values in the state.</p>
  
  <p><strong>Is there any way to do this in one line</strong></p>