ctdio / react-breadcrumbs-context

Flexible, router agnostic breadcrumbs implemented with React's context API.
MIT License
3 stars 2 forks source link

Handle crumbs changing #3

Closed ebroder closed 5 years ago

ebroder commented 5 years ago

If crumbs are, e.g., derived from props or state, and that state changes, this ensures that the breadcrumb gets updated, too.

(I don't have a good repro for this easy to hand, but it's pretty easy to see if you pass a function into withBreadcrumb)

coveralls commented 5 years ago

Pull Request Test Coverage Report for Build 26


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Provider.tsx 13 15 86.67%
<!-- Total: 18 20 90.0% -->
Totals Coverage Status
Change from base Build 23: -2.8%
Covered Lines: 62
Relevant Lines: 65

💛 - Coveralls
ebroder commented 5 years ago

Alright, put a test case together (thanks for the nudge, Coveralls). I don't really have any experience writing JS tests, so I'm sure there's plenty that could be improved; happy to take pointers.

ctdio commented 5 years ago

Thanks for the PR @ebroder! The change looks good to me and your test seems to validate that crumb replacement works. Merging this and publishing now.

ctdio commented 5 years ago

Published v1.1.0.