mirror of
https://github.com/rreusser/rreusser.github.io.git
synced 2026-02-01 17:20:38 +00:00
30 lines
516 B
JavaScript
30 lines
516 B
JavaScript
const React = require('react');
|
|
|
|
class Range extends React.PureComponent {
|
|
constructor(props) {
|
|
super(props);
|
|
}
|
|
|
|
handleChange(event) {
|
|
this.props.updateProps({
|
|
value: +event.target.value
|
|
});
|
|
}
|
|
|
|
render() {
|
|
const { value, min, max, step } = this.props;
|
|
return (
|
|
<input type="range" onChange={this.handleChange.bind(this)} value={value} min={min} max={max} step={step} />
|
|
);
|
|
}
|
|
}
|
|
|
|
Range.defaultProps = {
|
|
value: 0,
|
|
min: 0,
|
|
max: 1,
|
|
step: 1
|
|
};
|
|
|
|
export default Range;
|