Created
July 16, 2020 11:14
-
-
Save xxczaki/d07040a12b1d839de220988080b34fe3 to your computer and use it in GitHub Desktop.
Embed Changelog Podcast in your React app (works with SSR!)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, {useEffect} from 'react'; | |
| const Contact = (): JSX.Element => { | |
| useEffect(() => { | |
| const script = document.createElement('script'); | |
| script.src = 'https://cdn.changelog.com/embed.js'; // or, when hosting the script manually: require('../embed.js'); | |
| script.async = true; | |
| script.defer = true; | |
| document.body.append(script); | |
| }, []); | |
| return ( | |
| <audio | |
| controls | |
| data-theme="night" | |
| data-src="https://changelog.com/jsparty/85/embed" | |
| src="https://cdn.changelog.com/uploads/jsparty/85/js-party-85.mp3" | |
| preload="none" | |
| className="changelog-episode" | |
| /> | |
| ); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment