Creating the CollectionControls component

Now, when we understand what the Collection component renders, let's discuss its child components. We'll start with CollectionControls. Create the following ~/snapterest/source/components/CollectionControls.react.js file:

var React = require('react'); var Header = require('./Header.react'); var Button = require('./Button.react'); var CollectionRenameForm = require('./CollectionRenameForm.react'); var CollectionExportForm = require('./CollectionExportForm.react'); var CollectionControls = React.createClass({ getInitialState: function () { return { name: 'new', isEditingName: false }; }, getHeaderText: function () { var numberOfTweetsInCollection = this.props.numberOfTweetsInCollection; var text = numberOfTweetsInCollection; ...

Get React.js Essentials now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.