title: React, Binding input values
body: <p>I'm having some problems with binding the value of an input, I have done it on another component of my app and it worked fine, but somehow I can't get it works on another component. I'm only getting the first letter and not the whole text</p>
  
  <p>This is my component</p>
  
  <pre><code>class Post extends Component {
  
    constructor(props) {
      super(props);
      this.state = {
        post: this.props.data,
        comment: ''
      }
      Post.context = this;
    }
  render() {
  &lt;input type="text" value={this.state.comment} onChange={this.handleChange} placeholder="Write a comment..." /&gt;
        &lt;button className="button comments" onClick={this.handleClick.bind(null,this.state.post.id)}&gt;&lt;/button&gt;
  }
   handleChange(e) {
      Post.context.setState({comment: e.target.value});
  }
  }
  </code></pre>
  
  <p>I also tried to use an example from React website but it got the same result:</p>
  
  <pre><code> render() {
       var valueLink = {
        value: this.state.comment,
        requestChange: this.handleChange
      };
   render() {
      &lt;input type="text" valueLink={valueLink} placeholder="Write a comment..." /&gt;
            &lt;button className="button comments" onClick={this.handleClick.bind(null,this.state.post.id)}&gt;&lt;/button&gt;
      }
       handleChange(newValue) {
          Post.context.setState({comment: newValue});
      }
      }
  </code></pre>
  
  <p>Does someone have idea, why this is happening?</p>