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

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