Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/hot-routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// @flow
// This takes the ./routes.js file and makes it hot reload.
// This should only be used on the client, not on the server!
import { hot } from 'react-hot-loader';
import Routes from './routes';

export default hot(module)(Routes);
7 changes: 3 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ import queryString from 'query-string';
import Loadable from 'react-loadable';
import * as OfflinePluginRuntime from 'offline-plugin/runtime';
import { HelmetProvider } from 'react-helmet-async';
import { hot } from 'react-hot-loader';
import webPushManager from './helpers/web-push-manager';
import { history } from './helpers/history';
import { client } from 'shared/graphql';
import { initStore } from './store';
import { getItemFromStorage } from './helpers/localStorage';
import Routes from './routes';
import Routes from './hot-routes';
import { track, events } from './helpers/analytics';
import { wsLink } from 'shared/graphql';
import { subscribeToDesktopPush } from './subscribe-to-desktop-push';
Expand Down Expand Up @@ -49,7 +48,7 @@ const store = initStore(
}
);

const App = hot(module)(() => {
const App = () => {
return (
<Provider store={store}>
<HelmetProvider>
Expand All @@ -61,7 +60,7 @@ const App = hot(module)(() => {
</HelmetProvider>
</Provider>
);
});
};

const renderMethod = !!window.__SERVER_STATE__
? // $FlowIssue
Expand Down