mirror of
https://github.com/maputnik/editor.git
synced 2026-01-07 14:00:01 +00:00
Take advantage of transform-class-properties and use arrow functions instead of bind
This commit is contained in:
@@ -42,7 +42,7 @@ export default class PropertyGroup extends React.Component {
|
||||
spec: PropTypes.object.isRequired,
|
||||
}
|
||||
|
||||
onPropertyChange(property, newValue) {
|
||||
onPropertyChange = (property, newValue) => {
|
||||
const group = getGroupName(this.props.spec, this.props.layer.type, property)
|
||||
this.props.onChange(group , property, newValue)
|
||||
}
|
||||
@@ -56,7 +56,7 @@ export default class PropertyGroup extends React.Component {
|
||||
const fieldValue = fieldName in paint ? paint[fieldName] : layout[fieldName]
|
||||
|
||||
return <FunctionSpecField
|
||||
onChange={this.onPropertyChange.bind(this)}
|
||||
onChange={this.onPropertyChange}
|
||||
key={fieldName}
|
||||
fieldName={fieldName}
|
||||
value={fieldValue === undefined ? fieldSpec.default : fieldValue}
|
||||
|
||||
Reference in New Issue
Block a user