Skip to content

Commit

Permalink
Update Examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarkelov committed Apr 9, 2019
1 parent 981e721 commit 85490dc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions example/src/components/Examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ class Examples extends React.Component {
percent: null,
value: 0,
disabled: false,
range: {
min: 0,
max: 100,
},
};

onUpdate = index => (render, handle, value, un, percent) => {
Expand Down Expand Up @@ -44,6 +48,15 @@ class Examples extends React.Component {
this.setState(prevState => ({ disabled: !prevState.disabled }));
};

changeRange = () => {
this.setState({
range: {
min: 0,
max: 200,
},
});
};

render() {
const {
color,
Expand All @@ -52,6 +65,7 @@ class Examples extends React.Component {
skippingValue,
value,
disabled,
range,
} = this.state;
return (
<section className="options">
Expand Down Expand Up @@ -175,6 +189,11 @@ class Examples extends React.Component {
}}
/>
</div>
<div className="examples">
<h4>Change range by changing state:</h4>
<button onClick={this.changeRange}>Change range</button>
<Nouislider start={40} range={range} />
</div>
</section>
);
}
Expand Down

0 comments on commit 85490dc

Please sign in to comment.