Skip to content

Commit eb2e752

Browse files
authored
Merge pull request #162 from reactjs/controlled
Controlled Mode
2 parents ac1c1f8 + ccfaa65 commit eb2e752

25 files changed

+1137
-896
lines changed

.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
],
66
"plugins": [
77
"transform-object-rest-spread",
8-
"transform-class-properties"
8+
"transform-class-properties",
9+
["transform-react-remove-prop-types", { "mode": "wrap" }]
910
]
1011
}

dist/react-tabs.js

Lines changed: 546 additions & 468 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-tabs.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-tabs.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-tabs.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/basic/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import { Tab, Tabs, TabList, TabPanel } from '../../src/main';
3+
import { Tab, Tabs, TabList, TabPanel } from '../../src/index';
44
import '../../style/react-tabs.css';
55

66
const App = () => {

examples/conditional/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import { Tab, Tabs, TabList, TabPanel } from '../../src/main';
3+
import { Tab, Tabs, TabList, TabPanel } from '../../src/index';
44
import '../../style/react-tabs.css';
55

66
class App extends React.Component {

examples/dyno/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
33
import Modal from 'react-modal';
4-
import { Tab, Tabs, TabList, TabPanel } from '../../src/main';
4+
import { Tab, Tabs, TabList, TabPanel } from '../../src/index';
55
import '../../style/react-tabs.css';
66

77
Modal.setAppElement(document.getElementById('example'));
@@ -51,7 +51,7 @@ class App extends React.Component {
5151
removeTab = (index) => {
5252
this.setState({
5353
tabs: this.state.tabs.filter((tab, i) => i !== index),
54-
selectedIndex: this.state.selectedIndex - 1,
54+
selectedIndex: Math.max(this.state.selectedIndex - 1, 0),
5555
});
5656
}
5757

examples/focus/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import { Tab, Tabs, TabList, TabPanel } from '../../src/main';
3+
import { Tab, Tabs, TabList, TabPanel } from '../../src/index';
44
import '../../style/react-tabs.css';
55

66
class App extends React.Component {
@@ -10,7 +10,7 @@ class App extends React.Component {
1010
this.state = { inputValue: '' };
1111
}
1212

13-
handleInputChange(e) {
13+
handleInputChange = (e) => {
1414
this.forceUpdate();
1515
this.setState({ inputValue: e.target.value });
1616
}

examples/nested/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import { Tab, Tabs, TabList, TabPanel } from '../../src/main';
3+
import { Tab, Tabs, TabList, TabPanel } from '../../src/index';
44
import '../../style/react-tabs.css';
55

66
const App = () => {

0 commit comments

Comments
 (0)