Use ES Class Fields & Static Properties (#3008)
Use ES Class Fields & Static Properties (currently stage 2) for improve class outlook. Added babel-plugin-transform-class-properties as a Babel plugin.
This commit is contained in:
committed by
Eugen Rochko
parent
44a3584e2d
commit
2991a7cfe6
@ -13,6 +13,13 @@ const messages = defineMessages({
|
||||
|
||||
class ColumnSettings extends React.PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
settings: ImmutablePropTypes.map.isRequired,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
onSave: PropTypes.func.isRequired,
|
||||
intl: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
render () {
|
||||
const { settings, onChange, onSave, intl } = this.props;
|
||||
|
||||
@ -41,11 +48,4 @@ class ColumnSettings extends React.PureComponent {
|
||||
|
||||
}
|
||||
|
||||
ColumnSettings.propTypes = {
|
||||
settings: ImmutablePropTypes.map.isRequired,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
onSave: PropTypes.func.isRequired,
|
||||
intl: PropTypes.object.isRequired
|
||||
}
|
||||
|
||||
export default injectIntl(ColumnSettings);
|
||||
|
@ -4,12 +4,14 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
|
||||
class SettingText extends React.PureComponent {
|
||||
|
||||
constructor (props, context) {
|
||||
super(props, context);
|
||||
this.handleChange = this.handleChange.bind(this);
|
||||
}
|
||||
static propTypes = {
|
||||
settings: ImmutablePropTypes.map.isRequired,
|
||||
settingKey: PropTypes.array.isRequired,
|
||||
label: PropTypes.string.isRequired,
|
||||
onChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
handleChange (e) {
|
||||
handleChange = (e) => {
|
||||
this.props.onChange(this.props.settingKey, e.target.value)
|
||||
}
|
||||
|
||||
@ -28,11 +30,4 @@ class SettingText extends React.PureComponent {
|
||||
|
||||
}
|
||||
|
||||
SettingText.propTypes = {
|
||||
settings: ImmutablePropTypes.map.isRequired,
|
||||
settingKey: PropTypes.array.isRequired,
|
||||
label: PropTypes.string.isRequired,
|
||||
onChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default SettingText;
|
||||
|
Reference in New Issue
Block a user