mirror of
https://github.com/withastro/astro.git
synced 2025-01-20 22:12:38 -05:00
fbc2697653
* 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>
474 B
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" }} />