Skip to content

Commit

Permalink
Merge #1730
Browse files Browse the repository at this point in the history
1730: fix: correctly initialize import component context r=KnisterPeter a=KnisterPeter

The import component context should be initialized with undefined,
as this is the expected behavior of the Import Component.

Co-authored-by: Markus Wolf <mail@markus-wolf.de>
  • Loading branch information
bors[bot] and KnisterPeter committed Apr 15, 2021
2 parents 670e955 + e9dd60d commit 82251b2
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 82251b2

Please sign in to comment.