From 1948f9e767c5c8f7cb52337ce777a61b5ad1a599 Mon Sep 17 00:00:00 2001
From: Yamagishi Kazutoshi <ykzts@desire.sh>
Date: Sat, 22 Apr 2017 03:05:35 +0900
Subject: 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
---
 .../features/favourited_statuses/index.jsx         | 33 ++++++++++++----------
 1 file changed, 18 insertions(+), 15 deletions(-)

(limited to 'app/assets/javascripts/components/features/favourited_statuses/index.jsx')

diff --git a/app/assets/javascripts/components/features/favourited_statuses/index.jsx b/app/assets/javascripts/components/features/favourited_statuses/index.jsx
index 1e9dafbdd..d6f53bf33 100644
--- a/app/assets/javascripts/components/features/favourited_statuses/index.jsx
+++ b/app/assets/javascripts/components/features/favourited_statuses/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 ImmutablePropTypes from 'react-immutable-proptypes';
 import LoadingIndicator from '../../components/loading_indicator';
 import { fetchFavouritedStatuses, expandFavouritedStatuses } from '../../actions/favourites';
@@ -18,26 +18,20 @@ const mapStateToProps = state => ({
   me: state.getIn(['meta', 'me'])
 });
 
-const Favourites = React.createClass({
+class Favourites extends React.PureComponent {
 
-  propTypes: {
-    params: React.PropTypes.object.isRequired,
-    dispatch: React.PropTypes.func.isRequired,
-    statusIds: ImmutablePropTypes.list.isRequired,
-    loaded: React.PropTypes.bool,
-    intl: React.PropTypes.object.isRequired,
-    me: React.PropTypes.number.isRequired
-  },
-
-  mixins: [PureRenderMixin],
+  constructor (props, context) {
+    super(props, context);
+    this.handleScrollToBottom = this.handleScrollToBottom.bind(this);
+  }
 
   componentWillMount () {
     this.props.dispatch(fetchFavouritedStatuses());
-  },
+  }
 
   handleScrollToBottom () {
     this.props.dispatch(expandFavouritedStatuses());
-  },
+  }
 
   render () {
     const { statusIds, loaded, intl, me } = this.props;
@@ -58,6 +52,15 @@ const Favourites = React.createClass({
     );
   }
 
-});
+}
+
+Favourites.propTypes = {
+  params: PropTypes.object.isRequired,
+  dispatch: PropTypes.func.isRequired,
+  statusIds: ImmutablePropTypes.list.isRequired,
+  loaded: PropTypes.bool,
+  intl: PropTypes.object.isRequired,
+  me: PropTypes.number.isRequired
+};
 
 export default connect(mapStateToProps)(injectIntl(Favourites));
-- 
cgit 

