score:0

have you defined the props variable anywhere, as this appears to be your issue? react prop types are available on react.proptypes.

can you try this:

chatlist.proptypes = {
  url: react.proptypes.string.isrequired
};

score:2

a few issues i noticed, which hopefully solves this issue.

  1. since you are using es6 class to define react components, getinitialstate cannot be used like that. instead you should have:

    constructor(props) {
        super(props);
        this.state = { chat: [] };
    }
    
  2. you have chatlist.proptypes = … instead it should be chatlist.proptypes (small p) and props is undefined, hence your error about 'cannot access property string of undefined'

    chatlist.proptypes = {
        url: react.proptypes.string.isrequired
    };
    

Related Query

More Query from same tag