From e985e0dd481591ab157cad13cdbd332da457b225 Mon Sep 17 00:00:00 2001 From: Arunoda Susiripala Date: Mon, 13 Mar 2017 10:16:32 +0530 Subject: [PATCH] Use mitt instead of EventEmitter for the client HMR (#1399) error handling. --- client/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/index.js b/client/index.js index 6a453e5039245..dac29da8d1c29 100644 --- a/client/index.js +++ b/client/index.js @@ -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)