Solution to inject the script in the head while using create-react-app. Using craco to override creat-react-app htmlWebpackPlugin options, we can inject the script in the head. Then in index.js we wait with the initial render of the app until the DOM is loaded. So we can target the root element.
lhstraathof / react-inject-script-in-head Goto Github PK
View Code? Open in Web Editor NEWInject script in head while using create-react-app without ejecting