We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 627691a commit bbd7290Copy full SHA for bbd7290
examples/dyno/app.js
@@ -10,6 +10,7 @@ const App = React.createClass({
10
getInitialState() {
11
return {
12
isModalOpen: false,
13
+ selectedIndex: -1,
14
tabs: [
15
{label: 'Foo', content: 'This is foo'},
16
{label: 'Bar', content: 'This is bar'},
@@ -25,7 +26,7 @@ const App = React.createClass({
25
26
<p>
27
<button onClick={this.openModal}>+ Add</button>
28
</p>
- <Tabs>
29
+ <Tabs selectedIndex={this.state.selectedIndex}>
30
<TabList>
31
{this.state.tabs.map((tab, i) => {
32
return (
@@ -76,6 +77,9 @@ const App = React.createClass({
76
77
label: label,
78
content: content
79
});
80
+ this.setState({
81
+ selectedIndex: this.state.tabs.length - 1
82
+ });
83
this.closeModal();
84
},
85
0 commit comments