Creating a Collection component

You might recall that our topmost hierarchy Application component has two child components: Stream and Collection.

So far, we've discussed and implemented our Stream component and its child components. Next, we're going to focus on our Collection component.

Create the ~/snapterest/source/components/Collection.react.js file:

var React = require('react'); var ReactDOMServer = require('react-dom/server'); var CollectionControls = require('./CollectionControls.react'); var TweetList = require('./TweetList.react'); var Header = require('./Header.react'); var Collection = React.createClass({ createHtmlMarkupStringOfTweetList: function () { var htmlString = ReactDOMServer.renderToStaticMarkup( <TweetList tweets={this.props.tweets} ...

Get React.js Essentials 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.