docs icon indicating copy to clipboard operation
docs copied to clipboard

Caution against passing functions to HTML elements, framework components

Open Jutanium opened this issue 3 years ago • 1 comments

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.

Jutanium avatar Oct 04 '22 20:10 Jutanium

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...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Oct 04 '22 20:10 netlify[bot]

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.

Jutanium avatar Oct 19 '22 13:10 Jutanium

LGTM!

sarah11918 avatar Oct 20 '22 13:10 sarah11918