0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-20 22:12:38 -05:00
astro/.changeset/three-owls-drop.md
Erika fbc2697653
feat: update extended client:visible to use an object instead of a string (#9596)
* Revert "feat: support setting rootMargin for `client:visible` (#9363)"

This reverts commit 769826edbd.

* feat: update extended `client:visible` to use an object instead of a string

* Apply suggestions from code review

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

* test: add a test

* nit: comment

* test: write the test some other way to try to convince playwright

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2024-01-03 19:44:04 -05:00

474 B

astro
minor

Adds the ability to set a rootMargin setting when using the client:visible directive. This allows a component to be hydrated when it is near the viewport, rather than hydrated when it has entered the viewport.

<!-- Load component when it's within 200px away from entering the viewport -->
<Component client:visible={{ rootMargin: "200px" }} />