title: How can we do dynamic imports of Npm modules in React?
body: <p>I have seen the webpack <a href="https://webpack.js.org/guides/code-splitting/#dynamic-imports" rel="nofollow noreferrer">documentation</a> for dynamic imports (refer below image), but this doesn't seem to work in react as we return components directly in React rather than adding elements to DOM (after then() of the promise).</p>
  <p>In <a href="https://webpack.js.org/guides/code-splitting/#dynamic-imports" rel="nofollow noreferrer">React lazy loading documentation</a>, they have shown how to lazy load only other React components but not how to dynamic import NPM libraries.</p>
  <p>So if someone could explain how to dynamic import npm modules, that would be great.</p>
  <p><a href="https://i.stack.imgur.com/sZpf8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sZpf8.png" alt="enter image description here" /></a></p>