Skip to content

Commit e985e0d

Browse files
authored
Use mitt instead of EventEmitter for the client HMR (#1399)
error handling.
1 parent 57099a5 commit e985e0d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createElement } from 'react'
22
import ReactDOM from 'react-dom'
3-
import { EventEmitter } from 'events'
3+
import mitt from 'mitt'
44
import HeadManager from './head-manager'
55
import { createRouter } from '../lib/router'
66
import App from '../lib/app'
@@ -42,7 +42,7 @@ const headManager = new HeadManager()
4242
const container = document.getElementById('__next')
4343

4444
export default (onError) => {
45-
const emitter = new EventEmitter()
45+
const emitter = mitt()
4646

4747
router.subscribe(({ Component, props, hash, err }) => {
4848
render({ Component, props, err, hash, emitter }, onError)

0 commit comments

Comments
 (0)