-
Notifications
You must be signed in to change notification settings - Fork 5
[Content] Lazy load comments api call #3905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
|
I like the general idea. Would this be better implemented as a custom hook? this way we could apply the technique elsewhere? |
|
@shrunyan yeah, that makes sense. I'll do just that. |
|
@shrunyan converted to a hook as suggested |
@agalin920 I've updated the code to make use of the already existing intersection hook from react-use. I tried making eratic and fast scrolls and wasn't able to see any major slow downs on the app despite the button being re-rendered everytime due to the intersection observer. |
Only perform the api call to fetch comment by resource item when the component is in view to prevent firing off multiple api requests once a content item is loaded
Resolves #3897
Screencast_20251119_115912.webm