title: How to ensure jQuery at the global level in a React component?
body: <p>I am using froala editor in my React application which requires jQuery to be available at a global level. Now I know I can add below to my webpack file to ensure same:</p>
  
  <pre><code>plugins: [
  new webpack.ProvidePlugin({
    $: "jquery",
    jQuery: "jquery"
   })
  ]
  </code></pre>
  
  <p>but I don't want this to be part of my webpack config, is there a way I can pass same mapping (defined above) to my React component that is rendering froala editor?</p>
  
  <p>I came across options like:</p>
  
  <pre><code> window.$ = window.jQuery = require("jquery");
  </code></pre>
  
  <p>mentioned here <a href="https://github.com/webpack/webpack/issues/2180#issuecomment-196048732" rel="nofollow noreferrer">https://github.com/webpack/webpack/issues/2180#issuecomment-196048732</a> </p>
  
  <p>but I am unable to figure out how can declare this in froala editor component as window is accessible only after component has mounted.</p>