1) Do not make any side effects in componentWillMount, do it only in componentDidMount 2) if (Object.keys(this.props.match.params).length == 0) { } else { this.tag = this.props.match.params.tag; } do not store props values as class properties. 3) loadMore = (event) => { event.preventDefault(); this.page = this.page + 1; this.requestNews(); } do not use class properties to hold any mutable state. Component will not rerender if these properties change, use this.setState for them 4) <a onClick={event => this.filterTag(event, link)} Avoid creating inplace arrow functions and binds, extract <a> to separate component and use this.props.link in handleClick
Обсуждают сегодня