icd2k3/react-router-breadcrumbs-hoc

How do I add in between crumbs ?

udielenberg opened this issue · 2 comments

Hey!

I currently work with { disabledDefaults: true }.

this is a route I have:

const routes = [
   { 
       path: '/p/:projectId/environments/:environmentId' , 
       breadcrumb: ({ match }) => { ... return <span>{match.params[...]}</span>} },
   ...
]

Is there a way I could get this breadcrumb ${projectId} > Environments > ${environmentId}

@udielenberg yes that is possible. projectId and environmentId will both be in the match object. So, you could do something like this:

const routes = [
  {
    path: '/p/:projectId/environments/:environmentId',
    breadcrumb: ({ match }) => (
      <span>
        {match.params.projectId} > Environments > {match.params.environmentId}
      </span>
    ),
  }
]

thank you ! :)

I over complicated it ✋

Great library @icd2k3 ! thank you very much!