import React from 'react' export default class extends React.Component { constructor(props) { super() this.state = { value: props.initialValue || 0 } this.handleChange = this.handleChange.bind(this) } handleChange(e) { this.setState({ value: e.target.value }, () => { this.props.onChange(`${this.state.value}px`) }) } render() { const minValue = this.props.minValue || 0 const maxValue = this.props.maxValue || 100 return (
{this.props.label}
) } }