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/components/column_back_button_slim.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/components/column_back_button_slim.jsx')
-rw-r--r-- | app/assets/javascripts/components/components/column_back_button_slim.jsx | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/app/assets/javascripts/components/components/column_back_button_slim.jsx b/app/assets/javascripts/components/components/column_back_button_slim.jsx index 536964b01..0c753436b 100644 --- a/app/assets/javascripts/components/components/column_back_button_slim.jsx +++ b/app/assets/javascripts/components/components/column_back_button_slim.jsx @@ -1,5 +1,5 @@ -import PureRenderMixin from 'react-addons-pure-render-mixin'; import { FormattedMessage } from 'react-intl'; +import PropTypes from 'prop-types'; const outerStyle = { position: 'absolute', @@ -16,17 +16,16 @@ const iconStyle = { marginRight: '5px' }; -const ColumnBackButtonSlim = React.createClass({ +class ColumnBackButtonSlim extends React.PureComponent { - contextTypes: { - router: React.PropTypes.object - }, - - mixins: [PureRenderMixin], + constructor (props, context) { + super(props, context); + this.handleClick = this.handleClick.bind(this); + } handleClick () { this.context.router.push('/'); - }, + } render () { return ( @@ -39,6 +38,10 @@ const ColumnBackButtonSlim = React.createClass({ ); } -}); +} + +ColumnBackButtonSlim.contextTypes = { + router: PropTypes.object +}; export default ColumnBackButtonSlim; |