docs icon indicating copy to clipboard operation
docs copied to clipboard

Add a section on passing a class to a child component

Open Jutanium opened this issue 2 years ago • 1 comments

What kind of changes does this PR include?

  • New or updated content

Description

  • Closes #995
  • Adds a new section on the Styling page, per this comment
  • I focused on passing class, but made it clear that all HTML attributes don't automatically pass through
  • Shows two examples: one where you don't destructure props at all, and one where you destructure but rename

Jutanium avatar Oct 05 '22 15:10 Jutanium

Deploy Preview for astro-docs-2 ready!

Name Link
Latest commit c3cdce3d62f9bb898e66d592c768a1873d01b3b3
Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/635156a5a50c0d0009f091bc
Deploy Preview https://deploy-preview-1726--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 05 '22 16:10 netlify[bot]

I do like this section @Jutanium, BUT I don't love that the examples show TypeScript simply because NOTHING else on this page (or on most pages) does. It feels out of place. The passing props example in particular does not look like the rest of the docs at all.

That being said, I do think it would be good to have more TS content over time, maybe a Tab component that can flip between JS/TS? But I just think it seems out of place here, right now. What do you think?

sarah11918 avatar Oct 19 '22 16:10 sarah11918

That is a fair point Sarah — I guess the examples would also be more succinct and focused without the Props interfaces.

delucis avatar Oct 19 '22 16:10 delucis

@sarah11918 Removed the TS, should be good to go!

Jutanium avatar Oct 20 '22 12:10 Jutanium

LOOKS GOOD TO MERGE! @Jutanium

sarah11918 avatar Oct 20 '22 17:10 sarah11918

LGTM @Jutanium

sarah11918 avatar Oct 20 '22 18:10 sarah11918