Skip to content

Instantly share code, notes, and snippets.

@herkyl
Created July 27, 2024 10:09
Show Gist options
  • Save herkyl/e33855bb8849ad07d5a046e9a458b403 to your computer and use it in GitHub Desktop.
Save herkyl/e33855bb8849ad07d5a046e9a458b403 to your computer and use it in GitHub Desktop.
import React, { useEffect } from 'react';
const LoadPotioScript = () => {
useEffect(() => {
const script = document.createElement('script');
script.src = "https://webcomponent.potio.cc/index.js";
script.async = true;
document.body.appendChild(script);
return () => {
document.body.removeChild(script);
};
}, []);
return null;
};
const App = () => {
return (
<div className="App">
<h1>Hello, World!</h1>
<LoadPotioScript />
</div>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment