O'Reilly logo

React.js Essentials by Artemij Fedosejev

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

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; ...

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