Back
Question
Asked

Anyone using React Apollo with React Hot Loader?

I have a React app with GraphQL using Apollo. I set up react-hot-loader@next yesterday and it only works if I export each component as hot manually. I can't seem to get it to work globally on the root component.

export default hot(module)(App)


I think i understood some of these words.

FWIW, I set up the loader on the Routes component and it seems to be working with a You cannot change <Router routes>; it will be ignored error, which turns out to be harmless in react-router v3.

Ok so I got this working like this:

ReactDOM.render(
  <ApolloProvider client={client}>
    <Routes history={browserHistory} />
  </ApolloProvider>, document.getElementById('root')
);

if (module.hot) {
  module.hot.accept()
}

Another issue came up — after hot reloading a page where I had a form for mutations, I get an error when trying to run that mutation.

Uncaught (in promise) TypeError: _this.props.addApp is not a function