I am working with Node and React(NextJS) SSR based project, I have added createjs because I have javascript based animations, unfortunately it dosen't have NPM package so I download the minified js library and serving from local server, but after adding this library to HEAD after 20-30 seconds it gives response, when I tried this on plain HTML it takes just 20-30 miliseconds only to renponce. What should I do to minimize response time
componentDidMount(){
this.checkLib()
}
checkLib(){
setTimeout(()=>{
if(window.createjs){
console.log('library is ready')
}else{
this.checkLib()
}
},500)
}
render(){
return(
<Head>
{(typeof window !='undefined')
? <script src='./../static/js/createjs.min.js' />
:'' }
<Head>
)
}