Fix dependency arrays in multiple useEffect hooks for improved stability#181
Fix dependency arrays in multiple useEffect hooks for improved stability#181hxrshxz wants to merge 5 commits intoshopstr-eng:mainfrom
Conversation
|
@hxrshxz is attempting to deploy a commit to the shopstr-eng Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
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.
🚨 Linting & Formatting ReportPrettier found formatting issues. Run 🔍 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>
There was a problem hiding this comment.
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.
🚨 Linting & Formatting ReportPrettier found formatting issues. Run 🔍 Please fix these before merging. |
1 similar comment
🚨 Linting & Formatting ReportPrettier found formatting issues. Run 🔍 Please fix these before merging. |
🚨 Linting & Formatting ReportPrettier found formatting issues. Run 🔍 Please fix these before merging. |
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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.
🚨 Linting & Formatting ReportPrettier found formatting issues. Run 🔍 Please fix these before merging. |
|
@calvadev please review , thank you |
Description
Fixed React Hook useEffect missing dependency warnings by adding required dependecies to dependency arrays.
Resolved or fixed issue
Screenshots (if applicable)
Before
After
Affirmation
For more details on what to include, see:
Bug Report Template
Feature Request Template
Documentation Issue Template
Security Issue Template