Skip to content

Conversation

@preeesha
Copy link

Proposed changes

This PR pays attention to key prop missing at many places where items are rendered under the map function. I have added they key prop to improve performance and fix the mentioned issue.

Issue(s)

#4943

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

@preeesha
Copy link
Author

preeesha commented Dec 28, 2023

Hey @GleidsonDaniel,

I have made some fixes to the mentioned issue. When you have a moment, would you kindly review the changes I have made and provide any feedback? Please let me know if you have any questions or need any clarification on the updates.

Thank you for your time and consideration.

Regards,
Prisha Gupta

{fields.map(field => (
<Text style={[styles.text, styles.field, { color: themes[theme].bodyText }]}>{parser.text(field)}</Text>
{fields.map((field, index) => (
<Text key={index} style={[styles.text, styles.field, { color: themes[theme].bodyText }]}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay sir. Thanks for pointing that out.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue has not yet been resolved.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sir I find this one trivial as the field is of type any which means that using this as the key it can cause major bugs in future so that's the reason I have made use of the index here.

I would love to know suggestions.

@preeesha preeesha force-pushed the fix--render-key-errors branch from 0f774bc to 2cccebe Compare January 12, 2024 04:58
@preeesha
Copy link
Author

@GleidsonDaniel Sir I have made the necessary changes and reviewed the review. You can have a look.

Thanks for your time
Prisha Gupta

{fields.map(field => (
<Text style={[styles.text, styles.field, { color: themes[theme].bodyText }]}>{parser.text(field)}</Text>
{fields.map((field, index) => (
<Text key={index} style={[styles.text, styles.field, { color: themes[theme].bodyText }]}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue has not yet been resolved.

{avatarSuggestions.slice(0, 7).map(item => (
<AvatarSuggestionItem item={item} testID={`${item?.service}-avatar-suggestion`} onPress={onPress} />
{avatarSuggestions.slice(0, 7).map((item, index) => (
<AvatarSuggestionItem key={index} item={item} testID={`${item?.service}-avatar-suggestion`} onPress={onPress} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sir, now I have made use of the url of the avatar instead of indices as key as it was the most feasibly unique thing that differentiates each avatar better.
Let me know if you disagree with this.

Copy link
Author

@preeesha preeesha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed the suggestions and left the comments in the respective conversation.
Kindly provide your views on them.

@Rohit3523
Copy link
Collaborator

Hey @preeesha, are you still working on this PR?

@Rohit3523
Copy link
Collaborator

Closing this PR because it has multiple conflicts, hasn’t been updated for over a year and we now have a new PR #6775

@Rohit3523 Rohit3523 closed this Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants