Skip to content

Commit

Permalink
always use hydrate
Browse files Browse the repository at this point in the history
  • Loading branch information
lixiaoyan committed Oct 13, 2017
1 parent d717ef2 commit 54e110f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions entry/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const client = new ApolloClient({
}),
});

const render = (hydrate = false) => {
const render = () => {
const container = document.querySelector("#app");
const element = (
<AppContainer>
Expand All @@ -31,14 +31,10 @@ const render = (hydrate = false) => {
</ApolloProvider>
</AppContainer>
);
if (hydrate) {
ReactDOM.hydrate(element, container);
} else {
ReactDOM.render(element, container);
}
ReactDOM.hydrate(element, container);
};

render(true);
render();

if (module.hot) {
module.hot.accept(() => {
Expand Down

0 comments on commit 54e110f

Please sign in to comment.