From 1948f9e767c5c8f7cb52337ce777a61b5ad1a599 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi 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 --- .../javascripts/components/containers/mastodon.jsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'app/assets/javascripts/components/containers') diff --git a/app/assets/javascripts/components/containers/mastodon.jsx b/app/assets/javascripts/components/containers/mastodon.jsx index e303a8820..6aae23b62 100644 --- a/app/assets/javascripts/components/containers/mastodon.jsx +++ b/app/assets/javascripts/components/containers/mastodon.jsx @@ -1,4 +1,5 @@ import { Provider } from 'react-redux'; +import PropTypes from 'prop-types'; import configureStore from '../store/configureStore'; import { refreshTimelineSuccess, @@ -96,11 +97,7 @@ addLocaleData([ ...id, ]); -const Mastodon = React.createClass({ - - propTypes: { - locale: React.PropTypes.string.isRequired - }, +class Mastodon extends React.Component { componentDidMount() { const { locale } = this.props; @@ -145,14 +142,14 @@ const Mastodon = React.createClass({ } store.dispatch(showOnboardingOnce()); - }, + } componentWillUnmount () { if (typeof this.subscription !== 'undefined') { this.subscription.close(); this.subscription = null; } - }, + } render () { const { locale } = this.props; @@ -195,6 +192,10 @@ const Mastodon = React.createClass({ ); } -}); +} + +Mastodon.propTypes = { + locale: PropTypes.string.isRequired +}; export default Mastodon; -- cgit