opened
aaronjensen
username_0
Hi, we're testing out react-hot-loader@next and weren't able to get it working with redbox as we had it before. Ideally we could use it w/ create-react-app's react-error-overlay. Has anyone done this? My attempts at it were unsuccessful.

Thanks!
How to use next with react-error-overlay?
issue
created
theKashey
username_1
`errorReporter` prop should still work fine.
comment
created
aaronjensen
username_0
Maybe I was doing it wrong, but the setup I had from RHL3 didn't work. I was doing this in my src/index:

```js
// @flow
import * as React from 'react'
import ReactDOM from 'react-dom'
import { AppContainer } from 'react-hot-loader'
import Redbox from 'redbox-react'
import { getRoot } from '@@common'
import App from '@@app-ui/components/App'
import type { Config } from '@@app-ui/config'

const CustomErrorReporter = ({ error }) => <Redbox error={error} />
const render = (Component, config: Config) => {
  ReactDOM.render(
    <AppContainer errorReporter={CustomErrorReporter}>
      <Component config={config} />
    </AppContainer>,
    getRoot(),
  )
}

let storedConfig: void | Config
export const startApp = (config: Config) => {
  storedConfig = config
  render(App, config)
}

if (module.hot) {
  module.hot.accept('@@app-ui/components/App', () => {
    if (storedConfig) {
      render(App, storedConfig)
    }
  })
}

export default startApp
```
comment
created
theKashey
username_1
It does not show RedBox or literally does not work?
comment
created
aaronjensen
username_0
RedBox works, but react-hot-loader does not. It doesn't refresh the page, but it blows away the render tree
comment
created
theKashey
username_1
Wow! That unfair. 
Can you provide more data how to repeat this?
comment
created
aaronjensen
username_0
Sorry, to be clear by "blows away the render tree" what I meant was that it rerenders from scratch, scrapping any previous state. I'll see if I can put a repro together, though after trying w/ the webpack-modern example I couldn't reproduce what I'm seeing so I'll try and debug a little further on my repo first.
comment
created
TheAifam5
username_2
So I wrote also my own "RedBox" and after update to the new version, does not work anymore.
Also I set the RHL log level to debug but that does not help (no info).
I will try provide more information later (in 30 minutes) - gonna do some debugging.
comment
created
theKashey
username_1
One should pursue ts-loader. It somehow breaks webpack's HRM.
comment
created
neoziro
username_3
I would like to deprecate `errorReporter`, try to add a custom [Error Boundary](https://reactjs.org/blog/2017/07/26/error-handling-in-react-16.html) in your root component (just after `hot` or `AppContainer`) and it should work.
comment
closed
neoziro
username_3
issue
created
neoziro
username_3
Documented in [v4.0.0-beta.17](https://github.com/gaearon/react-hot-loader/releases/tag/v4.0.0-beta.17).
comment