Skip to content

docs(hooks): update useIntersection root example#9027

Open
ayu3456 wants to merge 1 commit into
mantinedev:masterfrom
ayu3456:docs/use-intersection-root-example
Open

docs(hooks): update useIntersection root example#9027
ayu3456 wants to merge 1 commit into
mantinedev:masterfrom
ayu3456:docs/use-intersection-root-example

Conversation

@ayu3456

@ayu3456 ayu3456 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates the useIntersection documentation example to avoid reading
containerRef.current during render.

The example now uses a callback ref with useState, ensuring the
IntersectionObserver is created with the correct root after the container
element is available.

Fixes #9026

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.

useIntersection: documented root: ref.current usage is a fragile init-order pattern

1 participant