How to use the @ant-design/pro-layout/lib/RouteContext.Consumer 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 tangtanglove / fullstack-backend / resources / frontend / src / components / PageHeaderWrapper / index.tsx View on Github external
var defaultPageHeaderRender = function defaultPageHeaderRender(props) {
  var title = props.title,
    content = props.content,
    pageHeaderRender = props.pageHeaderRender,
    extraContent = props.extraContent,
    restProps = _objectWithoutProperties(props, [
      'title',
      'content',
      'pageHeaderRender',
      'extraContent',
    ]);

  return React.createElement(RouteContext.Consumer, null, function(value) {
    if (pageHeaderRender) {
      return pageHeaderRender(_objectSpread({}, props, value));
    }

    return React.createElement(
      _PageHeader,
      Object.assign(
        {},
        value,
        {
          title: title,
        },
        restProps,
        {
          footer: renderFooter(restProps),
        },