Sawtaytoes
12/8/2018 - 8:57 PM

CommonJS `require` Syntax for using React lazy

The CommonJS method of using require to load asynchronous components instead of the newer ESModules import.

const TestComponent = (
  lazy(() => (
    Promise
    .resolve(
      require('./TestComponent')
    )
  ))
)