-
Notifications
You must be signed in to change notification settings - Fork 501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for itemKey property in RNPickerSelect component #586
Open
athul-22
wants to merge
2
commits into
lawnstarter:master
Choose a base branch
from
athul-22:add-itemKey-support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
remarkablemark
requested changes
Jul 26, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint failures:
Run yarn lint
yarn run v1.22.22
$ eslint "src/**/*.{js,jsx,ts,tsx}"
/home/runner/work/react-native-picker-select/react-native-picker-select/src/index.js
Error: 161:1 error This line has a length of 103. Maximum allowed is 100 max-len
Error: 169:7 error Replace `(!isEqual(this.props.itemKey,·prevProps.itemKey)` with `!isEqual(this.props.itemKey,·prevProps.itemKey` prettier/prettier
Error: 380:28 error Replace `⏎················?·[defaultStyles.doneDepressed,·style.doneDepressed]⏎···············` with `·?·[defaultStyles.doneDepressed,·style.doneDepressed]` prettier/prettier
Error: 392:30 error Replace `⏎··················?·[defaultStyles.doneTextDepressed,·style.doneTextDepressed]⏎·················` with `·?·[defaultStyles.doneTextDepressed,·style.doneTextDepressed]` prettier/prettier
Error: 419:27 error Replace `·Platform.OS·===·'android'·&&·fixAndroidTouchableBug⏎······?·{·height:·0,·width:·0,·flex:·1·}⏎·····` with `⏎······Platform.OS·===·'android'·&&·fixAndroidTouchableBug·?·{·height:·0,·width:·0,·flex:·1·}` prettier/prettier
Error: 427:13 error Expected no linebreak before this expression implicit-arrow-linebreak
Error: 431:11 error Unexpected newline before ')' function-paren-newline
Error: 453:28 error 'orientation' is assigned a value but never used no-unused-vars
Error: 579:42 error 'fixAndroidTouchableBug' is assigned a value but never used no-unused-vars
✖ 9 problems (9 errors, 0 warnings)
6 errors and 0 warnings potentially fixable with the `--fix` option.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR enhances the
RNPickerSelect
component by adding support for theitemKey
property. This allows for better handling of items with identical values but unique keys, providing a more robust selection mechanism. The changes include updates to the prop types, the constructor, and thegetSelectedItem
andcomponentDidUpdate
methods to utilizeitemKey
correctly.Changes Made
itemKey
prop toRNPickerSelect
PropTypes.constructor
to handleitemKey
.getSelectedItem
method to useitemKey
for item selection.componentDidUpdate
to check for changes initemKey
andvalue
.Related Issue
Motivation and Context
The
itemKey
property ensures that items with identical values can be uniquely identified and selected. This is particularly useful in scenarios where the same value might be associated with different keys, improving the flexibility and reliability of the component.How Has This Been Tested?
itemKey
.itemKey
.Types of changes
Checklist
Additional Notes
Please review the changes and let me know if there are any adjustments needed. Thank you!