Refactoring the CollectionControls component
The CollectionControls
component gets some major improvements as well. Let's take a look at the refactored version first, and then discuss what was updated and why:
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 CollectionActionCreators = require('../actions/CollectionActionCreators'); var CollectionStore = require('../stores/CollectionStore'); var CollectionControls = React.createClass({ getInitialState: function () { return { isEditingName: false }; }, getHeaderText: function () { var numberOfTweetsInCollection ...
Get React: Building Modern Web Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.