Skip to content

Commit b3d85b6

Browse files
committed
prevent log warning for missing getComponent in production
[email protected]
1 parent 4808c3a commit b3d85b6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/core/plugins/view/root-injects.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ export const getComponent = (getSystem, getStore, getComponents, componentName,
109109
let component = getComponents(componentName)
110110

111111
if(!component) {
112-
getSystem().log.warn("Could not find component", componentName)
112+
if (process.env.NODE_ENV !== "production") {
113+
// In the json schema rendering code, we optimistically query our system for a number of components.
114+
// If the component doesn't exist, these warnings get thrown (in non-production mode).
115+
getSystem().log.warn("Could not find component", componentName)
116+
}
113117
return null
114118
}
115119

0 commit comments

Comments
 (0)