How to use the react-router-breadcrumbs-hoc function in react-router-breadcrumbs-hoc

To help you get started, we’ve selected a few react-router-breadcrumbs-hoc 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 icd2k3 / react-router-breadcrumbs-hoc / types / react-router-breadcrumbs-hoc / react-router-breadcrumbs-hoc-tests.tsx View on Github external
matchOptions: { exact: true, strict: true },
  },
];

const Breadcrumbs = ({ breadcrumbs }: InjectedProps) => (
  <div>
    {breadcrumbs.map(({ breadcrumb, match }: BreadcrumbsProps, index: number) =&gt; (
      <span>
        {breadcrumb}
        {index &lt; breadcrumbs.length - 1 &amp;&amp; <i> / </i>}
      </span>
    ))}
  </div>
);

export default withBreadcrumbs(routes)(Breadcrumbs);
github ONEARMY / community-platform / src / pages / common / Header / CommunityHeader / Breadcrumb / Breadcrumb.tsx View on Github external
{breadcrumbs.map(({ match, breadcrumb }, index) =&gt; (
      <span>
        {index &gt; 0 ? ' &gt; ' : null}
        {index &lt; breadcrumbs.length - 1 ? (
          
            {breadcrumb}
          
        ) : (
          &lt;&gt; {breadcrumb} 
        )}
      </span>
    ))}
  
)

export default withBreadcrumbs(routes, { disableDefaults: true })(Breadcrumbs)
github nos / client / src / components / AuthenticatedLayout / Breadcrumbs / index.js View on Github external
import withBreadcrumbs from 'react-router-breadcrumbs-hoc';

import Breadcrumbs from './Breadcrumbs';
import BrowserBreadcrumb from './BrowserBreadcrumb';

const routes = [
  { path: '/browser/:query+', breadcrumb: BrowserBreadcrumb }
];

export default withBreadcrumbs(routes, { excludePaths: ['/'] })(Breadcrumbs);
github iotexproject / iotex-explorer / src / shared / common / navigation.tsx View on Github external
export const Navigation = ({
  routes
}: {
  routes?: Array;
}) =&gt; {
  const newRoutes = [...routesConfig, ...(routes || [])];
  const breadcrumbs = withBreadcrumbs(newRoutes, {
    excludePaths: ["/"]
  })(({ breadcrumbs }) =&gt; {
    return (
      <div style="{{">
        {breadcrumbs.map(({ match, breadcrumb }, index) =&gt; (
          <span>
            
              {index !== 0 &amp;&amp; ` &gt; `} {breadcrumb}
            
          </span>
        ))}
      </div>
    );
  });
  return React.createElement(breadcrumbs);
};

react-router-breadcrumbs-hoc

small, flexible, higher order component for rendering breadcrumbs with react-router 4.x

MIT
Latest version published 3 years ago

Package Health Score

56 / 100
Full package analysis