"use strict"; var App = React.createClass({ getDefaultProps() { return { gather: { gatherers: [] }, users: [], messages: [] } }, componentDidMount() { let self = this; socket.on("users:update", data => self.setProps({user: data.currentUser})); socket.on('users:update', data => self.setProps({users: data.users})); socket.on("message:append", data => { self.setProps({ messages: self.props.messages .concat(data.chatHistory) .sort((a, b) => { return new Date(a.createdAt) - new Date(b.createdAt); }) }); }); // Message History Retrieved socket.on("message:refresh", data => { self.setProps({ messages: data.chatHistory }); }); socket.emit("users:refresh"); socket.emit("message:refresh"); }, render() { return
{/**/}
{/**/}
} });