stormpath / stormpath-sdk-react

User Management and Authentication for React
Apache License 2.0
149 stars 57 forks source link

TypeError: this.context.router is undefined #54

Closed cbatesch closed 8 years ago

cbatesch commented 8 years ago

I've integrated stormpath via react and keep getting the error

TypeError: this.context.router is undefined

Here are my dependencies:

"dependencies": {,
   "babel-preset-react": "^6.5.0",
   "babelify": "^7.2.0",
   "jquery": "^2.2.1",
   "flux": "^2.1.1",
   "react-dom": "^0.14.7",
   "react-router": "^2.0.1",
   "react-stormpath": "^1.0.0",
   "react": "^0.14.7",
   "browserify": "^13.0.0",
   "reactify": "^1.1.1"
 },

This happens when I click on the <Link> component in my header:

var React = require('react');
var Link = require('react-router').Link;

var Header = React.createClass({
   render: function() {
       return(
                   <div className='nav-tools' id='nav-tools'>
                       <ul>
                               <li className='nav-link'><Link to='/profile'>Profile</Link></li>
                       </ul>
                   </div>
               </div>
           </header>
       );
   }
});

module.exports.Header = Header ;
typerandom commented 8 years ago

Hey!

How does it look when you are setting up your application? Are you calling ReactStormpath.init()? Also, are you using the Router from the react-stormpath library?

typerandom commented 8 years ago

Closing this since you've opened a support ticket instead.