Fix app hook lint errors#14
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 11 minutes and 27 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR addresses remaining react-hooks/set-state-in-effect lint errors in app runtime components by refactoring state synchronization patterns to avoid directly setting state within useEffect bodies.
Changes:
- Refactored
DocsSectionto derive the displayed doc from route state + local selection state, removing the effect-driven state sync. - Refactored
TourHighlightto update highlight positioning via anrequestAnimationFrame/event-driven callback rather than immediate effect body updates.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| app/features/sections/DocsSection.tsx | Removes effect-driven doc state syncing by deriving activeDoc from route param and local selection state. |
| app/components/system/TourHighlight.tsx | Moves rect updates into a callback scheduled via requestAnimationFrame and reused by scroll/resize events. |
| const animationFrameId = window.requestAnimationFrame(updateRect); | ||
|
|
||
| window.addEventListener('resize', updateRect); | ||
| window.addEventListener('scroll', updateRect, true); | ||
|
|
||
| return () => { | ||
| window.cancelAnimationFrame(animationFrameId); | ||
| window.removeEventListener('resize', updateRect); | ||
| window.removeEventListener('scroll', updateRect, true); | ||
| }; |
Summary
Validation
Notes