Search code examples
javascriptreactjsbootstrap-4

I want to use the bootstrap template in react , unable to use javascript files


I want to try using bootstrap template in React. I imported all the CSS files in my component page.

enter image description here

But I am unable to use the JavaScript files. I imported them in public/index.html inside the body. To work properly what should I do ?

I tried this for css, css is working fine I tried this for CSS. CSS is working fine

I tried adding js here ,but did not work I tried adding jS here,but did not work


Solution

  • I think for ensure working of JS smoothly you need to use the script as mentioned in the docs, for more refrence don't forget to check the docs -> https://react-bootstrap-v4.netlify.app/getting-started/introduction

    <script src="https://unpkg.com/react/umd/react.production.min.js" crossorigin></script>
    
    <script
      src="https://unpkg.com/react-dom/umd/react-dom.production.min.js"
      crossorigin></script>
    
    <script
      src="https://unpkg.com/react-bootstrap@next/dist/react-bootstrap.min.js"
      crossorigin></script>