Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

fix: memoize userdata prop passed to user profile component #5570

Conversation

psavan1655
Copy link
Contributor

@psavan1655 psavan1655 commented Mar 20, 2023

Fixes Issue

Closes #5535

Changes proposed

  • Only pass data which is needed by user profile component.
  • Currently all userData along with Links, Milestones ... were passed. So on changing sort order, data changes so userProfile components updates the component as data passed also contains Links/Milestones ... data. Though it is not needed in userProfile component.

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Screenshots

Note to reviewers

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

It's great having you contribute to this project

Welcome to the community 🤓

If you would like to continue contributing to open source and would like to do it with an awesome inclusive community, you should join our Discord chat and our GitHub Organisation - we help and encourage each other to contribute to open source little and often 🤓 . Any questions let us know.

@github-actions github-actions bot added the medium Pull request with changed lines between 10 and 30 label Mar 20, 2023
userData.tags,
userData.username,
]
);
Copy link
Member

Choose a reason for hiding this comment

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

But none of the user data changes, is this required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not because of user data. We are just extracting only the required user information for userProfile component.
Using memo to avoid assignment of new address on every re-render.

It is used to remove reviews, testimonials ... all the tabs data.

Copy link
Member

Choose a reason for hiding this comment

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

thank you for expelling @psavan1655 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Welcome @eddiejaoude .
Btw when are you planning to implement the user add by form feature? As i want to join with you during that.

Copy link
Member

Choose a reason for hiding this comment

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

Yes I started on that 👍 I should push what I have so far to a draft PR. I will try to do that this weekend

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you refer me other open source react related projects? with some intermediate-experienced level codebsae?
I would like to contribute more.

@eddiejaoude
Copy link
Member

Thank you for the contribution, as this code is growing for a feature that is not used, I have created a PR #5742 to remove the sorting so this PR is no longer needed.

Sorry for any inconvenience, I didn't think of this sooner

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
medium Pull request with changed lines between 10 and 30
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flickering seen on profile section, when use sorting option on below tabs
3 participants