Skip to content

Conversation

@Anirudh-020505
Copy link

Description

This PR improves React performance and rendering stability by fixing a missing useEffect dependency array and standardizing the use of unique IDs as keys when rendering lists.

What’s Changed

src/pages/Templates.jsx

  • Added an empty dependency array ([]) to useEffect to ensure the document title is set only once on component mount, preventing unnecessary re-renders.
  • Updated map functions to use unique IDs (t.id, c.id) as key values instead of array indices.

src/components/EditorHeader/Modal/New.jsx

  • Updated template list rendering to use temp.id as the key.

src/components/EditorCanvas/Canvas.jsx

  • Updated relationship list rendering to use e.id as the key.

Why This Matters

  • Prevents redundant re-renders caused by missing dependency arrays.
  • Improves React reconciliation by using stable, unique keys.
  • Aligns the codebase with React best practices for maintainability and performance.

@vercel
Copy link

vercel bot commented Dec 4, 2025

@Anirudh-020505 is attempting to deploy a commit to the dottle's projects Team on Vercel.

A member of the Team first needs to authorize it.

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