title: TypeError: window.intlTelInput is not a function in reactjs
body: <p>I am new in ReactJS and getting this error while using jQuery with React JS for intlTelInput I have install npm jQuery and import all the code which required for. I have also include all the CSS and jQuery Links in my index.html and still the code not working and I get this error</p>
  <blockquote>
  <p>TypeError: window.intlTelInput is not a function</p>
  </blockquote>
  <p>If anyone has any idea or solution regarding for this issue, please help me to find a way</p>
  <p>This is my <code>Index.html</code> page where I includes ALL the CDN links:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
    &lt;head&gt;
   
  
      &lt;link rel="stylesheet" href="build/css/intlTelInput.css"&gt;
      &lt;link href='https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css' rel='stylesheet' type='text/css'&gt;
      &lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.3/css/intlTelInput.min.css" /&gt;
      &lt;!-- JS --&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"&gt;&lt;/script&gt;
  
      &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.3/js/utils.min.js"&gt;&lt;/script&gt; 
    
      &lt;meta charset="utf-8" /&gt;
      &lt;link rel="icon" href="%PUBLIC_URL%/favicon.ico" /&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1" /&gt;
      &lt;meta name="theme-color" content="#000000" /&gt;
      &lt;meta
        name="description"
        content="Web site created using create-react-app"
      /&gt;
      &lt;link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /&gt;
    
      &lt;!--
        manifest.json provides metadata used when your web app is installed on a
        user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
      --&gt;
      &lt;link rel="manifest" href="%PUBLIC_URL%/manifest.json" /&gt;
  &lt;!-- ---------------------------------------------------------------------------- --&gt;
  
  
      &lt;!--
  
        
        Notice the use of %PUBLIC_URL% in the tags above.
        It will be replaced with the URL of the `public` folder during the build.
        Only files inside the `public` folder can be referenced from the HTML.
  
        Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
        work correctly both with client-side routing and a non-root public URL.
        Learn how to configure a non-root public URL by running `npm run build`.
      --&gt;
      &lt;title&gt;React App&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;noscript&gt;You need to enable JavaScript to run this app.&lt;/noscript&gt;
      &lt;div id="root"&gt;&lt;/div&gt;
      &lt;!--
        This HTML file is a template.
        If you open it directly in the browser, you will see an empty page.
  
        You can add webfonts, meta tags, or analytics to this file.
        The build step will place the bundled scripts into the &lt;body&gt; tag.
  
        To begin the development, run `npm start` or `yarn start`.
        To create a production bundle, use `npm run build` or `yarn build`.
      --&gt;
    &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>This is My Login Page Code.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React from 'react'
  import firebase from './firebase'
  import "./App.css";
  import { getDatabase, ref, child, get } from "firebase/database";
  // import PhoneInput from 'react-phone-number-input'
  import $ from 'jquery';
  import intlTelInputUtils from 'jquery';
  
  
  class Login extends React.Component {
    // &lt;--------------------------------------------------------------------------------------&gt;
  
    // jQuery code
  
    componentWillMount() {
  
      var phoneNumber = window.intlTelInput(document.querySelector("#phoneNumber"), {
        separateDialCode: true,
        preferredCountries: ["in"],
        hiddenInput: "full",
        utilsScript: "//cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.3/js/utils.js"
      });
  
      $("#getCode").click(function () {
        var full_num = phoneNumber.getNumber(intlTelInputUtils.numberFormat.E164);
        $("input[name='phoneNumber[full]'").val(full_num);
  
        localStorage.setItem("Phone_No", full_num)
  
      });
    }
    // // &lt;---------------------------------------------------------------------------------------------------------&gt;
  
    handleChange = (e) =&gt; {
      const { name, value } = e.target
      this.setState({
        [name]: value
      })
      this.setState({ phoneNumber: value }, () =&gt; {
        console.log(this.state.phoneNumber);
      });
    }
    configureCaptcha = () =&gt; {
      window.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('sign-in-button', {
        'size': 'invisible',
        'callback': (response) =&gt; {
  
          // reCAPTCHA solved, allow signInWithPhoneNumber.
  
          this.onSignInSubmit();
          // console.log("Recaptca varified")
        },
        //  defaultCountry: "IN"
      }
      );
    }
    onSignInSubmit = (e) =&gt; {
      e.preventDefault()
      this.configureCaptcha()
      const phoneNumber = this.state.mobile
      const appVerifier = window.recaptchaVerifier;
      const dbRef = ref(getDatabase());
      get(child(dbRef, `Users/${phoneNumber}`)).then((snapshot) =&gt; {
        if (snapshot.exists()) {
          firebase.auth().signInWithPhoneNumber(phoneNumber, appVerifier)
  
            .then((confirmationResult) =&gt; {
  
              // SMS sent. Prompt user to type the code from the message, then sign the
              // user in with confirmationResult.confirm(code).
  
              window.confirmationResult = confirmationResult;
  
              alert('An OTP has been sent to your registered mobile number')
              localStorage.setItem("Phone_No", phoneNumber)
              console.log(localStorage.getItem('Phone_No'));
  
  
            }).catch((error) =&gt; {
  
              console.error(error);
              alert("Oops! Some error occured. Please try again.")
            });
        }
        else {
          alert('Sorry, this mobile number is not registered with us. Please use your registered mobile number.');
        }
  
      })
    }
    onSubmitOTP = (e) =&gt; {
      e.preventDefault()
      const code = this.state.otp
      console.log(code)
      window.confirmationResult.confirm(code).then((result) =&gt; {
        // User signed in successfully.
        const Users = result.user;
        console.log(JSON.stringify(Users))
        this.props.history.push("/home");
      }).catch((error) =&gt; {
        alert("You have entered wrong code")
      });
    }
  
    render() {
      return (
        &lt;div className="Main-header"&gt;
          &lt;img src="./55k-logo.png" alt="Company Logo" style={{ height: "80px", width: "200px" }} /&gt;
          &lt;br /&gt;
          &lt;div&gt;
            &lt;h2&gt;Login Form&lt;/h2&gt;
            &lt;p&gt;Limtless Water. From Unlimited Air.&lt;/p&gt;
            &lt;form onSubmit={this.onSignInSubmit}&gt;
              &lt;div id="sign-in-button"&gt;&lt;/div&gt;
              {/* &lt;PhoneInput */}
  
              &lt;label&gt;Mobile Number&lt;/label&gt; &lt;br /&gt;
              {/* for="phoneNumber"  */}
  
              &lt;input type="tel" id="phone" name="mobile" placeholder="Enter Your Number" required onChange={this.handleChange} /&gt;
              &lt;div className="buttons"&gt;
                &lt;button type="submit"&gt;Submit&lt;/button&gt;
              &lt;/div&gt;
            &lt;/form&gt;
          &lt;/div&gt;
  
          &lt;div&gt;
            &lt;form onSubmit={this.onSubmitOTP}&gt;
              &lt;label &gt;Code&lt;/label&gt; &lt;br /&gt;
              {/* for="code" */}
  
              &lt;input type="number" name="otp" placeholder="Enter The 6 Digit OTP" required onChange={this.handleChange} /&gt;
              &lt;div className="buttons" &gt;
                &lt;button type="submit"&gt;Submit&lt;/button&gt;
              &lt;/div&gt;
            &lt;/form&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      )
    }
  }
  export default Login;</code></pre>
  </div>
  </div>
  </p>