Conversation
src/Select.js
Outdated
| if (this.props.autofocus) { | ||
| this.focus(); | ||
| if (typeof this.props.autofocus !== 'undefined' && typeof console !== 'undefined') { | ||
| console.warn('Warning: The autofocus prop will be deprecated in react-select1.0.0 in favor of autoFocus to match React\'s autoFocus prop'); |
There was a problem hiding this comment.
Please fix the indentation here
089fd96 to
b0d9f1f
Compare
|
@JedWatson indentation fixed and tests added |
b0d9f1f to
58aecaa
Compare
|
Wouldn't it be better to use a custom function for deprecation warning that returns an |
|
Thanks for the feedback @jochenberger, what's the purpose of returning an Error object in this case? |
|
IMHO, returning an |
src/Select.js
Outdated
| autoBlur: PropTypes.bool, // automatically blur the component when an option is selected | ||
| autofocus: PropTypes.bool, // autofocus the component on mount | ||
| autofocus: PropTypes.bool, // [DEPRECATED] autofocus the component on mount | ||
| autoFocus: PropTypes.bool, // autofocus the component on mount |
There was a problem hiding this comment.
@gwyneplaine please fix the in-line indentation here, should be using spaces for consistency
|
@jochenberger what makes you say that returning an error is more idiomatic react? we're explicitly continuing to support the |
|
@jochenberger I'm going to merge this as-is for now, I may have misunderstood what you meant with the error so please feel free to open another PR with how you meant for this to be implemented. I checked up on whether we should check for |
|
p.s. thanks @gwyneplaine 😁 |
|
I'm fine with that. I thought that returning an
I think that the warning will also appear in production. Maybe that should be changed. |
Add typo for `autoFocus` prop. Add `deprecated` comment for `autofocus`. See changes to the [PR](JedWatson/react-select#2002).
Add type for `autoFocus` props. Add `deprecated` comment for `autofocus`. See changet to the [PR](JedWatson/react-select#2002).
autoFocusprop added, deprecation warning added for use ofautofocusprop