title: How to import Json file with React lazy loading?
body: <p>I want to implement lazy loading in my React app but most of the files are JSON. Few of them are loading when the viewport width is less than e.g. 768px and I don't want to load them in the Desktop app when they are not needed. Is there any way to load the JSON file with React.lazy()? </p>
  
  <p>My JSON file is generated with Adobe After Effect extensions called: 'Bodymovin' and later I am importing this file like this: </p>
  
  <pre><code>import * as background from './background.json';
  import * as backgroundLarge from './background-large.json';
  import * as backgroundMedium from './background-medium.json';
  import * as backgroundMobile from './background-mobile.json';
  import * as backgroundSmallMobile from './background-smallMobile.json';
  import * as tree from './tree.json';
  import * as treeLarge from './tree-large.json';
  import * as treeMedium from './tree-medium.json';
  import * as treeMobile from './tree-mobile.json';
  import * as treeSmallMobile from './tree-smallMobile.json';
  </code></pre>
  
  <p>I was trying to load it normally like any other components with default export but it's not working.</p>
  
  <pre><code>const treeMedium = lazy(() =&gt; import('./tree-medium.json'));
  </code></pre>
  
  <p>When I import JSON normally I am using it later like this:</p>
  
  <pre><code>backgroundOptions: {
        loop: true,
        autoplay: true,
        animationData: background.default,
      },
  </code></pre>
  
  <p>And pass this object into <code>Lottie</code> component from <code>react-lottie</code></p>
  
  <p>Can I convert it to lazy loading or I am thinking wrong?</p>