Skip to content
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

No Jira - Allow react to compare component types on render #920

Merged
merged 4 commits into from
May 14, 2024

Conversation

dr-bizz
Copy link
Contributor

@dr-bizz dr-bizz commented Apr 22, 2024

Description

Preventing React from destroying the component tree on every render due to component types being recreated.
Updated all calls to Task Modal to use the new Enum I created.

I also fixed some imports.

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels. (Add the label "On Staging" to get the branch automatically merged into staging.)
  • I have requested a review from another person on the project

@dr-bizz dr-bizz requested a review from canac April 22, 2024 15:21
Copy link
Contributor

github-actions bot commented Apr 22, 2024

Bundle sizes [mpdx-react]

Compared against aad2df0

No significant changes found

Copy link
Contributor

@canac canac left a comment

Choose a reason for hiding this comment

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

Using an enum instead of a string, is a great idea! Thanks for making that change!

As I noted in the comments, I don't think that the changes to TaskModal will improve rendering performance. Although I could definitely be mistaken.

src/components/Task/Modal/TaskModal.tsx Outdated Show resolved Hide resolved
src/components/Task/Modal/TaskModal.tsx Show resolved Hide resolved
src/components/Task/Modal/TaskModal.tsx Outdated Show resolved Hide resolved
@canac canac force-pushed the lazy-components branch from 830f831 to da17fb4 Compare April 29, 2024 13:31
Base automatically changed from lazy-components to main April 29, 2024 14:24
dr-bizz added 3 commits April 30, 2024 11:43
… component types being recreated. Also updating lots of calls to Task Modal
@dr-bizz dr-bizz force-pushed the allow-react-to-compare-component-types-on-render branch from a785e17 to bb9bc22 Compare April 30, 2024 15:46
@dr-bizz
Copy link
Contributor Author

dr-bizz commented Apr 30, 2024

@canac, I had to rebase it to remove your changes from this PR. I've added some of the changes you recommended. I'm keeping the memo function and keeping the Modal content inside the return to keep it consistent with our other Components.

@dr-bizz dr-bizz merged commit b53eca5 into main May 14, 2024
18 checks passed
@dr-bizz dr-bizz deleted the allow-react-to-compare-component-types-on-render branch May 14, 2024 18:06
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.

2 participants