Skip to content

Commit

Permalink
fix(acc): fix default prop dev warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmajorc authored and levithomason committed Apr 24, 2017
1 parent 54e490e commit fbca20a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/AutoControlledComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export default class AutoControlledComponent extends Component {
const defaultPropName = getDefaultPropName(prop)
const { name } = this.constructor
// prevent defaultFoo={} along side foo={}
if (defaultPropName in this.props && prop in this.props) {
if (!_.isUndefined(this.props[defaultPropName]) && !_.isUndefined(this.props[prop])) {
console.error(
`${name} prop "${prop}" is auto controlled. Specify either ${defaultPropName} or ${prop}, but not both.`
)
Expand Down

0 comments on commit fbca20a

Please sign in to comment.