docs
docs copied to clipboard
Add a section on passing a class to a child component
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
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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
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?
That is a fair point Sarah — I guess the examples would also be more succinct and focused without the Props
interfaces.
@sarah11918 Removed the TS, should be good to go!
LOOKS GOOD TO MERGE! @Jutanium
LGTM @Jutanium