diff --git a/src/reconciler/resolver.js b/src/reconciler/resolver.js index 88e578f76..e1ce2c58f 100644 --- a/src/reconciler/resolver.js +++ b/src/reconciler/resolver.js @@ -68,5 +68,12 @@ export function resolveNotComponent(type) { export const resolveSimpleType = type => resolveProxy(type) || resolveUtility(type) || type; -export const resolveType = (type, options = {}) => - resolveProxy(type) || resolveUtility(type) || resolveNotComponent(type) || resolveComponent(type, options) || type; +export const resolveType = (type, options = {}) => { + if (!type) { + return type; + } + + return ( + resolveProxy(type) || resolveUtility(type) || resolveNotComponent(type) || resolveComponent(type, options) || type + ); +}; diff --git a/test/reactHotLoader.test.js b/test/reactHotLoader.test.js index c872b8898..8b9383da2 100644 --- a/test/reactHotLoader.test.js +++ b/test/reactHotLoader.test.js @@ -47,6 +47,13 @@ describe('reactHotLoader', () => { const DivProxy = OriginalReactMock.createElement.mock.calls[0][0]; expect(DivProxy[PROXY_KEY]).toBeDefined(); }); + + it('null case', () => { + reactHotLoader.patch(ReactMock); + const result = React.createElement(undefined); + + expect(result.type).toBeUndefined(); + }); }); describe('#createFactory', () => {