Removed redundant dot accesses in example

The `current` variable is defined on the top of the method.
pull/11004/merge
Thomas Billicsich 7 years ago committed by 偏右
parent 3fb478e743
commit ff70654ffe

@ -50,20 +50,20 @@ class App extends React.Component {
<Steps current={current}> <Steps current={current}>
{steps.map(item => <Step key={item.title} title={item.title} />)} {steps.map(item => <Step key={item.title} title={item.title} />)}
</Steps> </Steps>
<div className="steps-content">{steps[this.state.current].content}</div> <div className="steps-content">{steps[current].content}</div>
<div className="steps-action"> <div className="steps-action">
{ {
this.state.current < steps.length - 1 current < steps.length - 1
&& &&
<Button type="primary" onClick={() => this.next()}>Next</Button> <Button type="primary" onClick={() => this.next()}>Next</Button>
} }
{ {
this.state.current === steps.length - 1 current === steps.length - 1
&& &&
<Button type="primary" onClick={() => message.success('Processing complete!')}>Done</Button> <Button type="primary" onClick={() => message.success('Processing complete!')}>Done</Button>
} }
{ {
this.state.current > 0 current > 0
&& &&
<Button style={{ marginLeft: 8 }} onClick={() => this.prev()}> <Button style={{ marginLeft: 8 }} onClick={() => this.prev()}>
Previous Previous

Loading…
Cancel
Save