mking / react-hn

Learn React by building the Hacker News front page
424 stars 64 forks source link

getTitle not clearly specified #9

Open t3h2mas opened 8 years ago

t3h2mas commented 8 years ago

getTitle from js/NewsItem.js isn't clearly specified in the note above the NewsItem subtext section. Currently someone would have to either move the rendered code up to the getTitle method before going through the section, or they would have to scroll back through 2 previous sections to piece together the code. I think it could be done more clearly by including the whole method code in the NewsItem subtext section

  getTitle: function () {
    return (
      <div className="newsItem-title">
        <a className="newsItem-titleLink" href={this.props.item.url}>{this.props.item.title}</a>
        <span className="newsItem-domain">
          ({this.getDomain()})
        </span>
      </div>
    );
  },