icd2k3/react-router-breadcrumbs-hoc

Example code key in map is undefined

Closed this issue · 1 comments

In the sample code

  <div>
    {breadcrumbs.map((breadcrumb, index) => (
      <span key={breadcrumb.props.key}>
        <NavLink to={breadcrumb.props.match.url}>
          {breadcrumb}
        </NavLink>
        {(index < breadcrumbs.length - 1) && <i> / </i>}
      </span>
    ))}
  </div>

<span key={breadcrumb.props.key}> should be replaced with <span key={breadcrumb.key}> as breadcrumb.props does not contain a key in props

Thanks for reporting this! Updated the readme