Q: Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component I'm getting this warning:
Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the App component.    

There is also a problem where it seems to have mounted a component twice after I've done the signup. Then 3 times if I do another signup. How can I fix this? For example if I enter a message it is printed twice or three times.
var App = React.createClass({
        getInitialState: function() {
            return { messages: AppStore.getMessages() };
        },
        componentDidMount: function() {
            var socket = io('http://localhost:3000');
            AppStore.addChangeListener(this._onChange);
            AppStore.addSocket(socket);
        },
        componentUnmount: function() {
            AppStore.removeChangeListener(this._onChange);
        },
        render: function() {
            return (
                <div>
                    <ChannelsColumn/>
                    <Messages messages={this.state.messages}/>
                    <div className="footer">
                        <MessageInput/>
                    </div>
                </div>
            )
        },
        _onChange: function() {
            this.setState({ messages: AppStore.getMessages() });
        }
    });

Signup.js

    var Signup = React.createClass({
        getInitialState: function() {
            return {
                email: '',
                password: ''
            };
        },
        onChangeEmail: function(e) {
            this.setState({ email: e.target.value });
        },
        onChangePassword: function(e) {
            this.setState({ password: e.target.value });
        },
        handleSubmit: function() {
            var self = this;
            axios.post('/signup', { email: this.state.email, password: this.state.password })
                .then(function(response) {
                    sessionStorage.setItem('token', response.data.token);
                    self.props.history.push('/');
                });
        },
        render: function() {
            return (
                <div>
                    <header id="signup-header">

                    </header>

                    <form id="signup-form">
                        <section className="form-content">
                            <input type="text" placeholder="Email" value={this.state.email} onChange={this.onChangeEmail}/>
                            <input type="password" placeholder="Password" value={this.state.password} onChange={this.onChangePassword} id="password-field"/>
                        </section>
                        <div className="button-container">
                            <div type="submit" className="large-blue-button" onClick={this.handleSubmit}>Sign Up</div>
                        </div>
                    </form>

                </div>
            )
        }
    });

main.js
ReactDOM.render((
    <Router>
        <Route path="/" component={App} />
        <Route path="login" component={Login} />
        <Route path="signup" component={Signup} />
    </Router>),
    document.getElementById('app')
);


A: You have typo, React doesnt have such method like componentUnmount it should be componentWillUnmount. React docs
Thanks
