-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
Hi,
This looks great. I'm having trouble with the react part.
I have attached a screenshot of the errors. I think the main one is to do with React Router.
Could you please assist with setting it up correctly? I've used create-react-app as the boilderplate.
Also, here is is on my repo:
https://github.com/yarnball/ReactDjangoAuth
Thanks
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, hashHistory } from 'react-router';
import App from './App';
import './index.css';
import Login from './auth/login'
import auth from './auth/auth'
function requireAuth(nextState, replace) {
if (!auth.loggedIn()) {
replace({
pathname:'/app/login/',
state: {nextPathname: '/app/'}
})
}
}
ReactDOM.render(
<Router history={hashHistory}>
<Router path='/app/login/' component={Login} />
<Router path='/app/' component={App} onEnter={requireAuth} />
</Router>,
document.getElementById('app')
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels