O'Reilly logo

Mastering React by Ryan Vice, Adam Horton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

User views

Now that the session management and user store plumbing are in place, we turn our attention to user-related views and components.

The log in view

The log in view is our simplest form. Here's what it looks like in action:

The log in view

The log in view

Here's the source for the log in view:

File: js/views/login.jsx

import React from 'react'; import { History } from 'react-router'; import BasicInput from 'appRoot/components/basicInput'; import Actions from 'appRoot/actions'; export default React.createClass({ mixins: [ History ], getInitialState: function () { return {}; }, logIn: function (e) { var detail = {}; Array.prototype.forEach.call( e.target.querySelectorAll('input'), ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required