mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Use mitt instead of EventEmitter for the client HMR (#1399)
error handling.
This commit is contained in:
parent
57099a544c
commit
e985e0dd48
|
@ -1,6 +1,6 @@
|
|||
import { createElement } from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import { EventEmitter } from 'events'
|
||||
import mitt from 'mitt'
|
||||
import HeadManager from './head-manager'
|
||||
import { createRouter } from '../lib/router'
|
||||
import App from '../lib/app'
|
||||
|
@ -42,7 +42,7 @@ const headManager = new HeadManager()
|
|||
const container = document.getElementById('__next')
|
||||
|
||||
export default (onError) => {
|
||||
const emitter = new EventEmitter()
|
||||
const emitter = mitt()
|
||||
|
||||
router.subscribe(({ Component, props, hash, err }) => {
|
||||
render({ Component, props, err, hash, emitter }, onError)
|
||||
|
|
Loading…
Reference in a new issue