2017-01-05 17:27:39 +00:00
|
|
|
import patch from './patch-react'
|
2016-10-14 15:05:08 +00:00
|
|
|
|
2017-01-05 17:27:39 +00:00
|
|
|
// apply patch first
|
|
|
|
patch((err) => {
|
|
|
|
console.error(err)
|
2017-01-12 01:58:20 +00:00
|
|
|
|
|
|
|
Promise.resolve().then(() => {
|
|
|
|
onError(err)
|
|
|
|
})
|
2017-01-05 17:27:39 +00:00
|
|
|
})
|
|
|
|
|
2017-01-06 15:23:54 +00:00
|
|
|
require('react-hot-loader/patch')
|
|
|
|
|
2017-01-12 01:58:20 +00:00
|
|
|
const next = window.next = require('./')
|
|
|
|
|
|
|
|
next.default(onError)
|
|
|
|
|
|
|
|
function onError (err) {
|
|
|
|
// just show the debug screen but don't render ErrorComponent
|
|
|
|
// so that the current component doesn't lose props
|
|
|
|
next.render({ err })
|
|
|
|
}
|