Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The purpose of this PR is to allow the prop types from the
Select
component to be exported. The use case that this satisfies is to allow an application using thereact-select
to build a custom wrapper around theSelect
component (ie, to allow for customizations that serve business needs of the application, such as specific default prop values), but not need to copy-paste prop type code fromreact-select
to satisfy the prop-type checks. This duplicated prop-type code can simply be replaced with an import ofSelectPropTypes
fromreact-select
.I also made a couple other minor improvements, to hopefully improve the development experience for
react-select
contributors:.nvmrc
file. The README calls out that Node v4 should be used for development environments. Using this file enables better UX for contributors usingnvm
CONTRIBUTING.md
Feedback welcome. I hope this PR adds value to this project. Thank you.
UPDATE
One more thing I should note. I originally tried to export
SelectPropTypes
from the same file as theSelect
component,select.js
. I did this as a named export, alongside the default export ofSelect
. Unfortunately, this ended up breaking all tests of theSelect
component. I narrowed down the reason to behaviour of ES6 transpilation in this project. Before my changes (master branch),lib/Select.js
would contain this line:However, with the named export included, the
export
object would have itsdefault
andSelectPropTypes
properties set accordingly, but that latter line formodule.exports
would not appear. I decided to work around this by keeping a single export (the default) inSelect.js
and extractingSelectPropTypes
into its own file with anexport default
. I am open to hearing other suggestions to better exportSelectPropTypes
. This could also be a pattern for the prop types of other components for future PRs, as needed.