Open Falci opened 4 years ago
Maybe also on top of that we could build a makeScript
helper that defines script at module scope.
const useMyScript = makeScript({ url, id, type, async });
useMyScript.preload();
const Demo = () => {
const { data, error, isLoading } = useMyScript();
};
.preload()
could initiate loading already at module scope.
I will do it ~
For someone who need this feature right now. https://usehooks.com/useScript/
Is your feature request related to a problem? Please describe. Problem: I'd like to dynamically import scripts as
<script>
tags.Describe the solution you'd like Proposal:
Describe alternatives you've considered I'm using this the code above directly in my project.