fix: Slider should be a controlled component

This commit is contained in:
Benjy Cui
2015-11-17 10:31:10 +08:00
parent ae4be7392d
commit 6f0e618a30
4 changed files with 70 additions and 6 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ ReactDOM.render(
<div>
<div style={style}>
<p>Slider with marks, `included=true`</p>
<Slider marks={marks} defaultIndex={1} />
<Slider marks={marks} onChange={log} defaultIndex={1} />
</div>
<div style={style}>
<p>Slider with marks and steps, `included=true`</p>
@@ -36,7 +36,7 @@ ReactDOM.render(
</div>
<div style={style}>
<p>Range with marks and steps</p>
<Slider range marks={marks} step={10} onChange={log} defaultIndex={[1,2]} />
<Slider range marks={marks} step={10} defaultIndex={[1,2]} />
</div>
</div>
, document.getElementById('__react-content'));