Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix code snippet in working-with-video.md #19000

Merged
merged 1 commit into from
Oct 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/docs/working-with-video.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ If you would like more control over how YouTube (or similar) videos are embedded

In this reusable sample component, you could include props for video data like URL or title, any necessary markup for styling purposes, and the common `iframe` embed code:

```js:title=components/video.js
```jsx:title=src/components/video.js
import React from "react"
const Video = ({ videoSrcURL, videoTitle, ...props }) => (
<div className="video">
<iframe
Expand All @@ -37,6 +38,7 @@ const Video = ({ videoSrcURL, videoTitle, ...props }) => (
/>
</div>
)
export default Video
```

You would then include this component in a template or page with a video source URL and title passed in as props. The data for video URLs and titles can be sourced in multiple ways, such as importing JSON or [querying data from Markdown with GraphQL](#querying-data-from-markdown-with-graphql). You can also hard-code video data for something fun, like a custom 404 page with an Easter egg YouTube video:
Expand Down