diff options
author | Yamagishi Kazutoshi <ykzts@desire.sh> | 2017-04-22 03:05:35 +0900 |
---|---|---|
committer | Eugen <eugen@zeonfederated.com> | 2017-04-21 20:05:35 +0200 |
commit | 1948f9e767c5c8f7cb52337ce777a61b5ad1a599 (patch) | |
tree | 4d5f3549f6e5fd88340bb3543e1eb2eafc47952c /app/assets/javascripts/components/features/hashtag_timeline/index.jsx | |
parent | 27ea2a88c12835b491ea5537f934983470faf781 (diff) |
Remove deprecated features at React v15.5 (#1905)
* Remove deprecated features at React v15.5 - [x] React.PropTypes - [x] react-addons-pure-render-mixin - [x] react-addons-test-utils * Uncommented out & Add browserify_rails options * re-add react-addons-shallow * Fix syntax error from resolve conflicts * follow up 59a77923b368d48c590cd9f4a0c6b73ce972d33f
Diffstat (limited to 'app/assets/javascripts/components/features/hashtag_timeline/index.jsx')
-rw-r--r-- | app/assets/javascripts/components/features/hashtag_timeline/index.jsx | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/app/assets/javascripts/components/features/hashtag_timeline/index.jsx b/app/assets/javascripts/components/features/hashtag_timeline/index.jsx index 08d5f7f5b..5c091e17f 100644 --- a/app/assets/javascripts/components/features/hashtag_timeline/index.jsx +++ b/app/assets/javascripts/components/features/hashtag_timeline/index.jsx @@ -1,5 +1,5 @@ import { connect } from 'react-redux'; -import PureRenderMixin from 'react-addons-pure-render-mixin'; +import PropTypes from 'prop-types'; import StatusListContainer from '../ui/containers/status_list_container'; import Column from '../ui/components/column'; import { @@ -17,17 +17,7 @@ const mapStateToProps = state => ({ accessToken: state.getIn(['meta', 'access_token']) }); -const HashtagTimeline = React.createClass({ - - propTypes: { - params: React.PropTypes.object.isRequired, - dispatch: React.PropTypes.func.isRequired, - streamingAPIBaseURL: React.PropTypes.string.isRequired, - accessToken: React.PropTypes.string.isRequired, - hasUnread: React.PropTypes.bool - }, - - mixins: [PureRenderMixin], +class HashtagTimeline extends React.PureComponent { _subscribe (dispatch, id) { const { streamingAPIBaseURL, accessToken } = this.props; @@ -46,14 +36,14 @@ const HashtagTimeline = React.createClass({ } }); - }, + } _unsubscribe () { if (typeof this.subscription !== 'undefined') { this.subscription.close(); this.subscription = null; } - }, + } componentDidMount () { const { dispatch } = this.props; @@ -61,7 +51,7 @@ const HashtagTimeline = React.createClass({ dispatch(refreshTimeline('tag', id)); this._subscribe(dispatch, id); - }, + } componentWillReceiveProps (nextProps) { if (nextProps.params.id !== this.props.params.id) { @@ -69,11 +59,11 @@ const HashtagTimeline = React.createClass({ this._unsubscribe(); this._subscribe(this.props.dispatch, nextProps.params.id); } - }, + } componentWillUnmount () { this._unsubscribe(); - }, + } render () { const { id, hasUnread } = this.props.params; @@ -84,8 +74,16 @@ const HashtagTimeline = React.createClass({ <StatusListContainer type='tag' id={id} emptyMessage={<FormattedMessage id='empty_column.hashtag' defaultMessage='There is nothing in this hashtag yet.' />} /> </Column> ); - }, + } -}); +} + +HashtagTimeline.propTypes = { + params: PropTypes.object.isRequired, + dispatch: PropTypes.func.isRequired, + streamingAPIBaseURL: PropTypes.string.isRequired, + accessToken: PropTypes.string.isRequired, + hasUnread: PropTypes.bool +}; export default connect(mapStateToProps)(HashtagTimeline); |