4259 Fix option not being rebuild after isOptionDisabled prop changes#4349
Conversation
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 0fc0401:
|
b2b65b6 to
cc0596b
Compare
packages/react-select/src/Select.js
Outdated
| && isEqual(newProps.inputValue, lastProps.inputValue) | ||
| && isEqual(newProps.options, lastProps.options); | ||
| && isEqual(newProps.options, lastProps.options) | ||
| && newProps.isOptionDisabled === lastProps.isOptionDisabled; |
There was a problem hiding this comment.
If we're going to add functions to the memoization we should also include isOptionSelected, getOptionLabel, getOptionValue, filterOption, etc.
There was a problem hiding this comment.
I've added these and some other comparisons which are needed for rebuilding menu options. Do you expect to have tests for each of these? I've added one for the original issue.
…ecked using new function when isOptionDisabled prop changes
…ions whenever different option props are passed
63d053c to
2818847
Compare
|
@manvydasu Thanks for your work on this PR! We decided to actually take a different option and remove the memoization altogether (#4388) since we don't think it's realistic to maintain the memoization as it currently stands. We really appreciate your work on this and hope this solution works for you! |
#4259
This makes sure that options are being rebuilt whenever isOptionDisabled prop changes. The prop itself was not included into memoized option rebuild condition