React-bootstrap-typeahead: [React 16.2] Warning: Component Menu declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?

Created on 29 Nov 2017  路  10Comments  路  Source: ericgio/react-bootstrap-typeahead

Version

2.0.1

Steps to reproduce

  1. Install React 16.2, as it only repros with the latest version.
  2. In Chrome (or probably any other browser), open the dev console.
  3. Take any Typeahead instance you might have, and type enough characters to show the menu.

Expected Behavior

  1. No warnings/errors.

Actual Behavior

As soon as the menu pops up, React shows the following:
Warning: Component Menu declared ``PropTypes`` instead of ``propTypes``. Did you misspell the property assignment?

Most helpful comment

@ToJen The error you're seeing might be because you did something like

FieldWrapper.PropTypes = {
 foo: PropTypes.string.isRequired
}

the first PropTypes is supposed to be a small letter. It should be

FieldWrapper.propTypes = {
  foo: PropTypes.string.isRequired
}

All 10 comments

Nice catch, thanks!

Fixed in v2.0.2

Great, thanks for the quick fix! 馃憤

Looks like this issue still exists:

Warning: Component FieldWrapper declared ``PropTypes`` instead of ``propTypes``. Did you misspell the property assignment?

@ToJen: FieldWrapper isn't part of this package. The error you're seeing is coming from somewhere else.

@ToJen The error you're seeing might be because you did something like

FieldWrapper.PropTypes = {
 foo: PropTypes.string.isRequired
}

the first PropTypes is supposed to be a small letter. It should be

FieldWrapper.propTypes = {
  foo: PropTypes.string.isRequired
}

@illiteratewriter @ericgio I think my errors are either coming from react-native-clean-form or redux-form.

@illiteratewriter thanks,bro. It resolve my problem.

Thanks man!

FieldWrapper.--->p<---ropTypes = {
foo: PropTypes.string.isRequired
}

I learned something new today

Was this page helpful?
0 / 5 - 0 ratings