diff --git a/scm-ui-components/packages/ui-components/src/layout/Page.js b/scm-ui-components/packages/ui-components/src/layout/Page.js index 403bae91e6..c7a7f66cf4 100644 --- a/scm-ui-components/packages/ui-components/src/layout/Page.js +++ b/scm-ui-components/packages/ui-components/src/layout/Page.js @@ -51,7 +51,7 @@ class Page extends React.Component { let pageActionsExists = false; React.Children.forEach(children, child => { if (child && !error) { - if (child.type.name === PageActions.name) { + if (child.displayName === PageActions.displayName) { pageActions = (
{ let content = []; React.Children.forEach(children, child => { if (child) { - if (child.type.name !== PageActions.name) { + if (child.displayName !== PageActions.displayName) { content.push(child); } } diff --git a/scm-ui-components/packages/ui-components/src/layout/PageActions.js b/scm-ui-components/packages/ui-components/src/layout/PageActions.js index eb055a5605..d713e8ce11 100644 --- a/scm-ui-components/packages/ui-components/src/layout/PageActions.js +++ b/scm-ui-components/packages/ui-components/src/layout/PageActions.js @@ -8,7 +8,9 @@ type Props = { children: React.Node }; -class PageActions extends React.Component { +export default class PageActions extends React.Component { + displayName: string = "PageActions"; + render() { return <>{this.renderContent()}; } @@ -24,5 +26,3 @@ class PageActions extends React.Component { return children; } } - -export default PageActions;