June 2016
Intermediate to advanced
910 pages
18h 59m
English
The only previously defined view that needs modification for a logged-in user is the application header.
There's now a notion of the user being logged in. Adjustments need to be made to the application header to configure the links for login, logout, sign-up, and creating a new blog post. The application header component source now looks like this:
File: js/views/appHeader.jsx
import React from 'react'; import Reflux from 'reflux'; import { Link, History } from 'react-router'; import Actions from 'appRoot/actions'; import SessionStore from 'appRoot/stores/sessionContext'; export default React.createClass({ mixins: [ Reflux.connect(SessionStore, 'session'), History ], logOut: function () { Actions.logOut(); this.history.pushState('', ...Read now
Unlock full access