create-react-app
create-react-app copied to clipboard
not able to use defer in a dynamically generated script tag
Describe the bug : can't use defer in a script tag
using defer = true produces in the script tag same goes with async also
output : 👇

Did you try recovering your dependencies?
ans) there is nothing wrong with my dependencies
Which terms did you search for in User Guide?
ans ) i searched for
how to use defer in dynamically generated script tag in react
i got no solution for this
Environment
ans ) no output , i am using the latest react version
Steps to reproduce
i need to make a api call after a script tag is dynamically generated
- using let script = documet.createElement("script") , i created a script tag
- enabled defer for the tag ( script.defer = true ) 3.the output was not as expected
Expected behavior
ans ) creating a script with defer and async i.e "
Actual behavior
ans ) it creates a script with defer = " " and async = " " i.e "