title: Using PropTypes when immutable-js in react-js
body: <p>I am using immutable-js and react-immutable-proptypes in React.</p>
  
  <pre><code>// CommentBox.jsx
  getInitialState() {
      return {
          comments: Immutable.List.of(
              {author: 'Pete Hunt', text: 'Hey there!'},
              {author: 'Justin Gordon', text: 'Aloha from @railsonmaui'}
          )
      };
  },
  render(){
      console.log(this.state.comments.constructor);
      return (
        &lt;div className='commentBox container'&gt;
          &lt;h1&gt;Comments&lt;/h1&gt;
          &lt;CommentForm url={this.props.url} /&gt;
          &lt;CommentList comments={this.state.comments} /&gt;
        &lt;/div&gt;
      );
  }
  
  
  // CommentList.jsx
  propTypes: {
      comments: React.PropTypes.instanceOf(Immutable.List),
  },
  
  // CommentStore.js
  handleAddComment(comment) {
      this.comments.push(comment);
  }
  </code></pre>
  
  <p>When the page initialization, it's no problem,all is ok,no warning.
  The console log shows the <code>comments</code> is <code>function List(value)</code>.
  When I add a new comment, it looks work well,but there is a warning </p>
  
  <blockquote>
    <p>Warning: Failed propType: Invalid prop <code>comments</code> supplied to
    <code>CommentList</code>, expected instance of <code>List</code>. Check the render method of
    <code>CommentBox</code>.</p>
  </blockquote>
  
  <p>and the console log shows that the <code>comments</code> is <code>function Array()</code>.
  So, why does the <code>comments</code> constructor change from <code>List</code> to <code>Array</code>?</p>
  
  <p>And and I have read <a href="http://facebook.github.io/react/docs/advanced-performance.html#immutable-js-and-flux" rel="noreferrer">http://facebook.github.io/react/docs/advanced-performance.html#immutable-js-and-flux</a>.</p>
  
  <blockquote>
    <p>The messages store could keep track of the users and messages using
    two lists:</p>
  
  <pre><code>this.users = Immutable.List();
  this.messages = Immutable.List();
  </code></pre>
    
    <p>It should be pretty straightforward to implement functions to process
    each payload type. For instance, when the store sees a payload
    representing a new message, we can just create a new record and append
    it to the messages list:</p>
  
  <pre><code>this.messages = this.messages.push(new Message({
    timestamp: payload.timestamp,
    sender: payload.sender,
    text: payload.text
  });
  </code></pre>
    
    <p>Note that since the data structures are immutable, we need to assign
    the result of the push function to this.messages.</p>
  </blockquote>