Created
July 27, 2024 10:09
-
-
Save herkyl/e33855bb8849ad07d5a046e9a458b403 to your computer and use it in GitHub Desktop.
This file contains 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 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