Skip to content

Fix redundant updates in MappingHome by restricting componentDidUpdate#27

Open
PratikshaJ-16 wants to merge 2 commits intoOpenConceptLab:masterfrom
PratikshaJ-16:fix/restrict-componentDidUpdate
Open

Fix redundant updates in MappingHome by restricting componentDidUpdate#27
PratikshaJ-16 wants to merge 2 commits intoOpenConceptLab:masterfrom
PratikshaJ-16:fix/restrict-componentDidUpdate

Conversation

@PratikshaJ-16
Copy link
Copy Markdown

This PR improves the behavior of componentDidUpdate in MappingHome.jsx.

Changes:

  1. refreshDataByURL() is now triggered only when location.pathname changes.
    2.highlightFromSearch() runs only when searchMeta changes.

Why:

Previously, highlightFromSearch() was executed on every update, which could lead to unnecessary re-renders and redundant operations.
This change ensures updates occur only when relevant props change, improving performance and stability.

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.

1 participant