Skip to content

Fix dependency arrays in multiple useEffect hooks for improved stability#181

Open
hxrshxz wants to merge 5 commits intoshopstr-eng:mainfrom
hxrshxz:fix/useEffect-warnings
Open

Fix dependency arrays in multiple useEffect hooks for improved stability#181
hxrshxz wants to merge 5 commits intoshopstr-eng:mainfrom
hxrshxz:fix/useEffect-warnings

Conversation

@hxrshxz
Copy link
Contributor

@hxrshxz hxrshxz commented Sep 27, 2025

Description

Fixed React Hook useEffect missing dependency warnings by adding required dependecies to dependency arrays.

Resolved or fixed issue

Screenshots (if applicable)

Before

image

After

image

Affirmation

For more details on what to include, see:

Bug Report Template
Feature Request Template
Documentation Issue Template
Security Issue Template

Copilot AI review requested due to automatic review settings September 27, 2025 15:38
@vercel
Copy link

vercel bot commented Sep 27, 2025

@hxrshxz is attempting to deploy a commit to the shopstr-eng Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Fixes React Hook useEffect missing dependency warnings by adding required dependencies to dependency arrays in multiple components. This addresses linting warnings that could potentially cause bugs related to stale closures.

  • Updated dependency arrays in useEffect hooks to include all referenced variables
  • Added useCallback wrapper for calculateVisibleImages function in checkout-card component
  • Imported useCallback from React for proper memoization

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pages/settings/shop-profile.tsx Added reset function to useEffect dependency array
pages/index.tsx Added router object to useEffect dependency array
components/utility-components/checkout-card.tsx Added useCallback import, wrapped calculateVisibleImages with useCallback, and updated dependency arrays
components/product-form.tsx Added oldValues to useEffect dependency array
components/messages/message-feed.tsx Added hookProps.tabs to useEffect dependency array
components/messages/chat-button.tsx Added pubkeyOfChat to useEffect dependency array
components/home/marketplace.tsx Added focusedPubkey to useEffect dependency array

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link

🚨 Linting & Formatting Report

Prettier found formatting issues. Run npx prettier --write . locally.

🔍 Please fix these before merging.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link

🚨 Linting & Formatting Report

Prettier found formatting issues. Run npx prettier --write . locally.

🔍 Please fix these before merging.

1 similar comment
@github-actions
Copy link

🚨 Linting & Formatting Report

Prettier found formatting issues. Run npx prettier --write . locally.

🔍 Please fix these before merging.

@github-actions
Copy link

🚨 Linting & Formatting Report

Prettier found formatting issues. Run npx prettier --write . locally.

🔍 Please fix these before merging.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link

🚨 Linting & Formatting Report

Prettier found formatting issues. Run npx prettier --write . locally.

🔍 Please fix these before merging.

@hxrshxz
Copy link
Contributor Author

hxrshxz commented Nov 14, 2025

@calvadev please review , thank you

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

Comments