title: Getting "Cannot read property 'attachToForm' of undefined" after upgrading to the latest packages
body: <p>I have been stuck after upgrading to formsy-material-ui (0.4.0), formsy-react (0.18.0) and material-ui (0.15.0-beta.1) to latest versions, always getting <code>Cannot read property 'attachToForm' of undefined</code> before upgrading the modules, all was working fine.</p>
  
  <p>Have tried several options without any luck.</p>
  
  <p>Posting the Login component code which takes us to another route <code>ccall</code> but right before that got to see the attachToFrom error.</p>
  
  <p>I am fairly new to ReactJS, so may also provide any additional feedback to improve the code if any.</p>
  
  <pre class="lang-js prettyprint-override"><code>import React from "react";
  import Formsy from 'formsy-react';
  
  import { Router, Route, IndexRoute, hashHistory, browserHistory } from "react-router";
  import axios from 'axios';
  
  import Config from '../config';
  
  import lightBaseTheme from 'material-ui/styles/baseThemes/lightBaseTheme';
  import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
  import getMuiTheme from 'material-ui/styles/getMuiTheme';
  
  import RaisedButton from 'material-ui/RaisedButton';
  import FlatButton from 'material-ui/FlatButton';
  
  import { FormsyCheckbox, FormsySelect, FormsyText } from 'formsy-material-ui/lib';9
  
  
  const styles = {
    block: {
      maxWidth: 200,
      display:'inline-block',
      marginTop: '5px'
    },
    btnPos: {
      float: 'right',
      textTransform:'initial'
    },
    checkboxFpassword: {
      marginTop: 10,
    },
  };
  
  window.loginData = {};
  
  export default class Login extends React.Component {
  
      constructor(props, context) {
          super(props, context)
  
          this.state = {
              error: false,
              invalidUser: false,
        errorMsg: '',
              networkError: false,
              checked: true,
              canSubmit: false,
              errorMessages: {
              emailError: "Please enter a valid email or mobile",
              passwordError: "Password should be alphanumeric!"
                  }
              },
  
              this.loginSuccess = this.loginSuccess.bind(this);
              this.loginError = this.loginError.bind(this);
      }
  
  
    enableButton = () =&gt; {
      this.setState({
        canSubmit: true
      });
    }
  
    disableButton = () =&gt; {
      this.setState({
        canSubmit: false
      });
    }
  
    getChildContext() {
      return {muiTheme: getMuiTheme(lightBaseTheme)};
    }
  
    submitForm = (model) =&gt; {
        this.handleSubmit(model)
    }
  
    loginSuccess (response) {
      if (response.data &amp;&amp; (response.data.Response &amp;&amp; response.data.ResponseCode === "Success")) {
        loginData = Object.assign(loginData, response.data.Response);
        console.info("loginData =&gt;", loginData);
        //browserHistory.push('ccall');
              //router.push('ccall');
        this.context.router.replace('ccall');
      } else if (response.data.ResponseCode === "Failure"){
        this.setState({
          errorMsg: response.data.ErrorMessage
        });
      } else {
          console.log(response.data.ErrorMessage);
          this.setState({ invalidUser: true });
      }
    }
  
    loginError (response) {
      if (response instanceof Error) {
        console.error('Error', response.message);
        this.setState({ networkError: true });
      } else {
        this.setState({ networkError: true });
      }
    }
  
      handleSubmit = (data) =&gt; {
      console.log("handleSubmit this.state.canSubmit", this.state.canSubmit);
      if (this.state.canSubmit) {
        this.checkLogin(data);
      }
    }
  
    checkLogin (data) {
      let config = {
        email: data.email,
        password: data.password
      }
  
      let configParams = config.email + '/' + config.password;
  
      console.info("configParams", configParams);
  
      axios.get(Config.urls.login + configParams)
      .then(this.loginSuccess)
      .catch(this.loginError);
    }
  
    render() {
  
      return (
  
          &lt;div class="container login-container"&gt;
        &lt;div class = "logo"&gt;
          &lt;img src="./images/ezycare-logo.png" alt=""/&gt;
        &lt;/div&gt;
                  &lt;Formsy.Form
                  onValid={this.enableButton}
                  onInvalid={this.disableButton}
                  onValidSubmit={this.submitForm}
                &gt;
  
           &lt;FormsyText
             name='email'
             validationError={this.state.errorMessages.emailError}
             required
             floatingLabelText="Email/Mobile"
             style = {{width: '100%'}}
           /&gt;
  
           &lt;FormsyText
             name='password'
             required
             floatingLabelText="Password"
             type="password"
             style = {{width: '100%'}}
           /&gt;
                {this.state.invalidUser &amp;&amp; (
              &lt;p class="error"&gt;Invalid username or password, please try again!&lt;/p&gt;)}
              {this.state.networkError &amp;&amp; (
              &lt;p class="error"&gt;Network error, please check your internet connection!&lt;/p&gt;)}
              {this.state.errorMsg !== '' &amp;&amp; (
              &lt;p class="error"&gt;{this.state.errorMsg}&lt;/p&gt;)}
  
              &lt;RaisedButton 
                  label="Sign in" 
                  primary={true}
                  //disabled={!this.state.canSubmit}
              backgroundColor="#00AEEF"
              fullWidth={true}
                  type="submit"
            /&gt;
              &lt;br /&gt;
  
              &lt;div style={styles.checkboxFpassword}&gt;
                &lt;FormsyCheckbox
                  name="agree"
                  label="Remember me"
                  defaultChecked={true}
                  style={styles.block}
                /&gt;
  
                &lt;FlatButton 
                  label="Forgot Password" 
                  style={styles.btnPos}
                /&gt;
              &lt;/div&gt;
  
            &lt;/Formsy.Form&gt;
  
              &lt;/div&gt;
      );
    }
  
  }
  
  Login.contextTypes = {
    router: React.PropTypes.object.isRequired
  }
  
  //the key passed through context must be called "muiTheme"
  Login.childContextTypes = {
    muiTheme: React.PropTypes.object.isRequired,
  };
  </code></pre>
  
  <p>This is my package.json</p>
  
  <pre><code>{
    "name": "test",
    "version": "0.0.0",
    "description": "",
    "main": "webpack.config.js",
    "dependencies": {
      "axios": "^0.9.1",
      "formsy-material-ui": "^0.4.0",
      "history": "^2.1.0"
    },
    "peerDependencies": {
      "react": "^15.0.1",
      "react-dom": "^15.0.1",
      "react-router": "^2.3.0",
      "react-tap-event-plugin": "^1.0.0",
      "material-ui": "0.15.0-beta.1"
    },
    "devDependencies": {
      "babel-loader": "^6.2.0",
      "babel-plugin-add-module-exports": "^0.1.2",
      "babel-plugin-react-html-attrs": "^2.0.0",
      "babel-plugin-transform-class-properties": "^6.3.13",
      "babel-plugin-transform-decorators-legacy": "^1.3.4",
      "babel-preset-es2015": "^6.3.13",
      "babel-preset-react": "^6.3.13",
      "babel-preset-stage-0": "^6.0.14",
      "babel-eslint": "^6.0.0",
      "eslint": "^2.5.1",
      "eslint-plugin-react": "^4.0.0",
      "formsy-react": "^0.18.0",
      "material-ui": "0.15.0-beta.1",
      "react": "^15.0.1",
      "react-dom": "^15.0.1",
      "react-router": "^2.3.0",
      "react-tap-event-plugin": "^1.0.0",
      "webpack": "^1.12.14",
      "webpack-dev-server": "^1.14.0"
    },
    "scripts": {
      "dev": "webpack-dev-server --content-base src --inline --hot --host localhost --port 4444",
      "prod": "webpack --env=production",
       "lint": "eslint src &amp;&amp; echo \"eslint: no lint errors\""
    },
    "license": "ISC"
  }
  </code></pre>