Add useUpdateEffect hook to update following state #4107
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
🤖[deprecated] Generated by Copilot at 22f1d49
This pull request refactors the follow button and modal functionality in the profile page. It extracts the follow logic and state from the
ViewProfile
andFollowDialog
components and moves it to a custom hook and aFollowButton
component inside theDetails
component. This simplifies the code, improves performance, and removes the unused fileFollowDialog.tsx
.Related issues
Fixes # (issue)
Type of change
Explanation of the changes
🤖[deprecated] Generated by Copilot at 22f1d49
ViewProfile
component (link, link, link, link, link, link)FollowDialog
component and file (link)following
state internally byDetails
component and update it based onisFollowedByMe
prop (link, link)useUpdateEffect
hook fromusehooks-ts
library to run an effect only whenisFollowedByMe
prop changes (link)Emoji
🪄🗑️🎛️