Skip to content

Commit

Permalink
Can not reproduce error described in stereobooster/react-snap#72
Browse files Browse the repository at this point in the history
  • Loading branch information
stereobooster committed Dec 28, 2017
1 parent eed044c commit e99665c
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 16 deletions.
72 changes: 60 additions & 12 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,66 @@ import Nav from "./components/Nav";
import NavLink from "./components/NavLink";
import loadable from "loadable-components";

const Home = loadable(() => import("./views/Home"), {
LoadingComponent: () => null
});
const About = loadable(() => import("./views/About"), {
LoadingComponent: () => null
});
const Countries = loadable(() => import("./views/Countries"), {
LoadingComponent: () => null
});
const NoMatch = loadable(() => import("./views/NoMatch"), {
LoadingComponent: () => null
});
const Home = loadable(
() => {
const x = import("./views/Home");
console.log(1);
x.then(y => console.log(y));
console.log(2);
return x;
},
{
LoadingComponent: () => {
console.log("LoadingComponent: ./views/Home");
return null;
}
}
);
const About = loadable(
() => {
const x = import("./views/About");
console.log(1);
x.then(y => console.log(y));
console.log(2);
return x;
},
{
LoadingComponent: () => {
console.log("LoadingComponent: ./views/About");
return null;
}
}
);
const Countries = loadable(
() => {
const x = import("./views/Countries");
console.log(1);
x.then(y => console.log(y));
console.log(2);
return x;
},
{
LoadingComponent: () => {
console.log("LoadingComponent: ./views/Countries");
return null;
}
}
);
const NoMatch = loadable(
() => {
const x = import("./views/NoMatch");
console.log(1);
x.then(y => console.log(y));
console.log(2);
return x;
},
{
LoadingComponent: () => {
console.log("LoadingComponent: ./views/NoMatch");
return null;
}
}
);

const title = "You Are Doing Great";
const routes = [
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { hydrate, render } from "react-dom";
// import { render } from 'react-dom';
import App from "./App";
import "./index.css";
import registerServiceWorker from "./registerServiceWorker";
// import { unregister } from "./registerServiceWorker";
// import registerServiceWorker from "./registerServiceWorker";
import { unregister } from "./registerServiceWorker";
import { BrowserRouter } from "react-router-dom";

import { loadComponents } from "loadable-components";
Expand All @@ -29,5 +29,5 @@ if (rootElement.hasChildNodes()) {
}

// render(<App />, rootElement);
registerServiceWorker();
// unregister();
// registerServiceWorker();
unregister();

0 comments on commit e99665c

Please sign in to comment.