How to use the @ant-design/pro-layout/es/getPageTitle function in @ant-design/pro-layout

To help you get started, we’ve selected a few @ant-design/pro-layout examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Jkanon / webmagician-ui / src / layouts / Components / ProLayout / index.tsx View on Github external
const defaultPageTitleRender = (pageProps: GetPageTitleProps, props: BasicLayoutProps): string => {
  const { pageTitleRender } = props;
  if (pageTitleRender === false) {
    return props.title || '';
  }
  if (pageTitleRender) {
    const title = pageTitleRender(pageProps);
    if (typeof title === 'string') {
      return title;
    }
    warning(
      typeof title === 'string',
      'pro-layout: renderPageTitle return value should be a string',
    );
  }
  return defaultGetPageTitle(pageProps);
};