Skip to content

Commit

Permalink
fix: correctly initialize import component context
Browse files Browse the repository at this point in the history
The import component context should be initialized with undefined,
as this is the expected behavior of the Import Component.

Closes #1729
  • Loading branch information
KnisterPeter committed Apr 15, 2021
1 parent 670e955 commit e9dd60d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/react/import-component/context.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createContext } from 'react';

const context = createContext({});
const context = createContext(undefined);

context.displayName = 'Hops.ImportComponent';

Expand Down
2 changes: 1 addition & 1 deletion packages/react/import-component/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const importComponent = (
}

return createElement(Importer, {
hasModules: Boolean(modules),
hasModules: Boolean(modules && modules.length > 0),
loader,
render,
ownProps,
Expand Down

0 comments on commit e9dd60d

Please sign in to comment.