docs
docs copied to clipboard
Caution against passing functions to HTML elements, framework components
What kind of changes does this PR include?
- New or updated content
Description
- Closes #1588
- Caution for passing functions to elements in the Dynamic Attributes section of Astro Components
- Adds a "passing props to framework components" section (to match "passing children to framework components")
- Adds a caution in that section for passing functions as props to hydrated framework components
This was my best guess for placement; the "passing event handlers in Astro components" could deserve a spot in the troubleshooting section, too.
Deploy Preview for astro-docs-2 ready!
| Name | Link |
|---|---|
| Latest commit | 282efec5413ae0e869aa5ad0be9f6a5634f1e289 |
| Latest deploy log | https://app.netlify.com/sites/astro-docs-2/deploys/63514f3f7d881d0008296aa0 |
| Deploy Preview | https://deploy-preview-1720--astro-docs-2.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
I added a working example alongside the broken one. I agree that there's a danger in showing bad examples, but I don't think it's clear what the gotcha is without one.
LGTM!