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 59a77923b3
This commit is contained in:
parent
27ea2a88c1
commit
1948f9e767
83 changed files with 1441 additions and 1291 deletions
|
@ -1,4 +1,4 @@
|
|||
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
||||
import PropTypes from 'prop-types';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||
import ColumnCollapsable from '../../../components/column_collapsable';
|
||||
|
@ -25,16 +25,7 @@ const rowStyle = {
|
|||
|
||||
};
|
||||
|
||||
const ColumnSettings = React.createClass({
|
||||
|
||||
propTypes: {
|
||||
settings: ImmutablePropTypes.map.isRequired,
|
||||
onChange: React.PropTypes.func.isRequired,
|
||||
onSave: React.PropTypes.func.isRequired,
|
||||
intl: React.PropTypes.object.isRequired
|
||||
},
|
||||
|
||||
mixins: [PureRenderMixin],
|
||||
class ColumnSettings extends React.PureComponent {
|
||||
|
||||
render () {
|
||||
const { settings, onChange, onSave, intl } = this.props;
|
||||
|
@ -62,6 +53,13 @@ const ColumnSettings = React.createClass({
|
|||
);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
ColumnSettings.propTypes = {
|
||||
settings: ImmutablePropTypes.map.isRequired,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
onSave: PropTypes.func.isRequired,
|
||||
intl: PropTypes.object.isRequired
|
||||
}
|
||||
|
||||
export default injectIntl(ColumnSettings);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
|
||||
const style = {
|
||||
|
@ -9,18 +10,16 @@ const style = {
|
|||
width: '100%'
|
||||
};
|
||||
|
||||
const SettingText = React.createClass({
|
||||
class SettingText extends React.PureComponent {
|
||||
|
||||
propTypes: {
|
||||
settings: ImmutablePropTypes.map.isRequired,
|
||||
settingKey: React.PropTypes.array.isRequired,
|
||||
label: React.PropTypes.string.isRequired,
|
||||
onChange: React.PropTypes.func.isRequired
|
||||
},
|
||||
constructor (props, context) {
|
||||
super(props, context);
|
||||
this.handleChange = this.handleChange.bind(this);
|
||||
}
|
||||
|
||||
handleChange (e) {
|
||||
this.props.onChange(this.props.settingKey, e.target.value)
|
||||
},
|
||||
}
|
||||
|
||||
render () {
|
||||
const { settings, settingKey, label } = this.props;
|
||||
|
@ -36,6 +35,13 @@ const SettingText = React.createClass({
|
|||
);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
SettingText.propTypes = {
|
||||
settings: ImmutablePropTypes.map.isRequired,
|
||||
settingKey: PropTypes.array.isRequired,
|
||||
label: PropTypes.string.isRequired,
|
||||
onChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default SettingText;
|
||||
|
|
|
@ -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 { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||
|
@ -14,14 +14,7 @@ const mapStateToProps = state => ({
|
|||
hasUnread: state.getIn(['timelines', 'home', 'unread']) > 0
|
||||
});
|
||||
|
||||
const HomeTimeline = React.createClass({
|
||||
|
||||
propTypes: {
|
||||
intl: React.PropTypes.object.isRequired,
|
||||
hasUnread: React.PropTypes.bool
|
||||
},
|
||||
|
||||
mixins: [PureRenderMixin],
|
||||
class HomeTimeline extends React.PureComponent {
|
||||
|
||||
render () {
|
||||
const { intl, hasUnread } = this.props;
|
||||
|
@ -32,8 +25,13 @@ const HomeTimeline = React.createClass({
|
|||
<StatusListContainer {...this.props} type='home' emptyMessage={<FormattedMessage id='empty_column.home' defaultMessage="You aren't following anyone yet. Visit {public} or use search to get started and meet other users." values={{ public: <Link to='/timelines/public'><FormattedMessage id='empty_column.home.public_timeline' defaultMessage='the public timeline' /></Link> }} />} />
|
||||
</Column>
|
||||
);
|
||||
},
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
HomeTimeline.propTypes = {
|
||||
intl: PropTypes.object.isRequired,
|
||||
hasUnread: PropTypes.bool
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(injectIntl(HomeTimeline));
|
||||
|
|
Reference in a new issue