Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
React 16 compatibility, round 2
Browse files Browse the repository at this point in the history
  • Loading branch information
MoOx committed Sep 27, 2017
1 parent 1dbc5be commit ee106d2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/plugin-renderer-react/src/createApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ import createStore from "./shared/store";

const debug = require("debug")("phenomic:plugin:react");

const render =
typeof document !== "undefined" &&
!document.querySelector("#phenomic-DevLoader") &&
ReactDOM.hydrate
? ReactDOM.hydrate
: ReactDOM.render;

let store;

export const renderApp = (routes: () => React.Element<any>) => {
Expand All @@ -31,7 +38,7 @@ export const renderApp = (routes: () => React.Element<any>) => {
: undefined
);

ReactDOM.render(
render(
<AppContainer>
<Provider fetch={createFetchFunction()} store={store}>
{routes()}
Expand Down

1 comment on commit ee106d2

@JulienPradet
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

Please sign in to comment.