Commit e985e0dd authored by Arunoda Susiripala's avatar Arunoda Susiripala Committed by GitHub

Use mitt instead of EventEmitter for the client HMR (#1399)

error handling.
parent 57099a54
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment