Can't seem to be able to redirect without using internal instance of react -
i had use move new page: this._reactinternalinstance._context.history.push('/page-one');
this.context {}
this.props {}
anyone have hint fix doing wrong here? thanks
package.json relevant parts
"history": "^1.17.0", "lodash": "^3.10.1", "react": "^0.14.3", "react-addons-css-transition-group": "^0.14.3", "react-datagrid": "^2.0.1", "react-dom": "^0.14.3", "react-multi-dropdown": "^1.0.1", "react-router": "^1.0.3", "react-select": "^0.9.1", "reflux": "^0.3.0", import react 'react'; import reflux 'reflux'; import routercontext 'react-router'; import history 'history'; import auth '../stores/auth-store'; module.exports = react.createclass({ mixins: [ reflux.listento(auth, 'ondatachange'), history ], loginclicked(event) { if (auth.loggedin()) { this._reactinternalinstance._context.history.push('/page-one'); } },
you need specify contexttypes able use this.context. see https://facebook.github.io/react/docs/context.html.
Comments
Post a Comment