How to load script in react component

前端 未结 5 1774
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-29 16:45

I am having following script file



        
5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-29 17:18

    I recommend using React Helmet. I've used it on a couple of Create-React-Apps, and it allows you to write actual script tags combined with vanilla JS.

    It makes the process a lot smoother. So for you it'd be something like this once you've imported React Helmet.

    
    
                                     
                  
提交回复
热议问题