Skip to content

Commit

Permalink
fix(AutoControlledComponent): rename state method
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Fedyashov authored and levithomason committed Jul 16, 2017
1 parent 2b906ed commit f1dfd47
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/AutoControlledComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default class AutoControlledComponent extends Component {
super(...args)

const { autoControlledProps } = this.constructor
const state = _.invoke(this, 'getInitialState', this.props) || {}
const state = _.invoke(this, 'getInitialAutoControlledState', this.props) || {}

if (process.env.NODE_ENV !== 'production') {
const { defaultProps, name, propTypes } = this.constructor
Expand Down
2 changes: 1 addition & 1 deletion src/modules/Accordion/Accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default class Accordion extends Component {
static Content = AccordionContent
static Title = AccordionTitle

getInitialState({ exclusive }) {
getInitialAutoControlledState({ exclusive }) {
return { activeIndex: exclusive ? -1 : [-1] }
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/Tab/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Tab extends Component {

static Pane = TabPane

getInitialState() {
getInitialAutoControlledState() {
return { activeIndex: 0 }
}

Expand Down
2 changes: 1 addition & 1 deletion test/specs/lib/AutoControlledComponent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let TestClass
const createTestClass = (options = {}) => class Test extends AutoControlledComponent {
static autoControlledProps = options.autoControlledProps
static defaultProps = options.defaultProps
getInitialState() {
getInitialAutoControlledState() {
return options.state
}
render = () => <div />
Expand Down

0 comments on commit f1dfd47

Please sign in to comment.