Skip to content

Instantly share code, notes, and snippets.

@xxczaki
Created July 16, 2020 11:14
Show Gist options
  • Select an option

  • Save xxczaki/d07040a12b1d839de220988080b34fe3 to your computer and use it in GitHub Desktop.

Select an option

Save xxczaki/d07040a12b1d839de220988080b34fe3 to your computer and use it in GitHub Desktop.
Embed Changelog Podcast in your React app (works with SSR!)
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