Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// @flow
import {hot, setConfig} from 'react-hot-loader'
import * as React from 'react'
import Counter from './Counter'
import imported, {lazy, ComponentLoader, printDrainHydrateMarks} from 'react-imported-component'
import Portal from './Portal'
import Indirect from './indirectUsage';
imported(() => import(/* webpackChunkName: "namedChunk-1" */'./DeferredRender'), {
async: true
});
const Async = imported(() => import(/* webpackChunkName: "namedChunk-1" */'./DeferredRender'));
const Async2 = lazy(() => {
console.log('loading lazy');
return import(/* webpackChunkName: "namedChunk-2" */'./Lazy')
});
const ShouldNotBeImported = imported(() => import(/* webpackChunkName: "namedChunk-2" */'./NotImported'));
const App = () => (
<h1>
<p>Component loaded</p>
import(/* webpackChunkName: "namedChunk-1" */'./DeferredRender')}
/>
<p>test!</p>
<hr>
<p>C: </p>
<hr>
<p>Imported: </p></h1>
import * as React from "react";
import {Helmet} from "react-helmet";
import {Link} from "react-router-dom";
import imported, {lazy, LazyBoundary, remapImports} from "react-imported-component";
const LZ = lazy(() => import("./LazyTarget"));
const ND = imported(
() => remapImports(
import('./NotDefault'),
({NotDefault}) => NotDefault
)
);
const Home = () => (
<div>
<title>Homepage!</title>
Link to Another
<div>Hello!</div>
</div>