Skip to content

Conversation

@ryanbonial
Copy link
Member

@ryanbonial ryanbonial commented Jan 14, 2026

Description

This PR updates the React SDK documentation in two ways:

  1. Updates the event type names in the useDocumentEvent example to match the actual event types returned by the API (edited, published, deleted, etc. instead of documentEdited, documentPublished, etc.)

  2. Adds a new section demonstrating viewport-based lazy loading with useDocumentProjection using a ref to only fetch content when an element becomes visible in the viewport

What to review

  • Check that the event type names in the useDocumentEvent example are correct
  • Review the new "Viewport-Based Lazy Loading" section for accuracy and clarity
  • Ensure the code example for lazy loading with refs is properly formatted and follows best practices

Testing

Documentation changes only, no functional changes to test.

Fun gif

Lazy loading cat

@ryanbonial ryanbonial requested a review from a team as a code owner January 14, 2026 19:31
@ryanbonial ryanbonial requested a review from mttdnt January 14, 2026 19:31
@vercel
Copy link

vercel bot commented Jan 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
sdk-docs Ready Ready Preview, Comment Jan 14, 2026 7:32pm
sdk-kitchensink-react Ready Ready Preview, Comment Jan 14, 2026 7:32pm

Comment on lines +499 to +502
projection: '{ title, excerpt }',
})

return <div ref={ref}>{data?.title}</div>
Copy link
Member

Choose a reason for hiding this comment

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

May wanna leave off the excerpt if it's not used?

Copy link
Member Author

Choose a reason for hiding this comment

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

Showing the ref is the important part of this example, so I wanted to how where it came from.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry I mean excerpt from the projection — it's not used in the example code, right?

@ryanbonial ryanbonial requested a review from colepeters January 14, 2026 22:10
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.

2 participants