Scott Rippey
Scott Rippey
Ok, well, I've given this more thought. 1. This library should support the singleton router better. The current approach for unit tests, via `jest.mock`, works fine. However, the Provider-based approach...
Yes, I was going to talk about `next/link` because that one is interesting too... Basically, to mock it using the `alias` approach, you'd need another alias, since `next/link` imports from...
Oh, you're right. With Next 12.2 they changed the way `next/link` works: #58 There's actually some sample code in that issue that fixes it, but would only work for jest....
@amolagre That's a separate issue; you can follow along here: #58 Also, judging by that error message, can you check that you're not importing the `next-10` version? You might have...
I've found a fundamental flaw with this approach. Supplying a "default value" for the context is not a good solution, because the value will never update, so the `next/link` will...
The ONLY way I can think of handling this, currently, is for all tests to add a `` wrapper. I can probably add this feature, but would need help testing...
@meinaart This PR would be extremely useful ... I hope this project hasn't been abandoned! Please merge this PR. Thank you!
I think I see the issue. The hook has a deps array with `elementRef.current`. The problem is due to React's lifecycle, which happens in this order: 1. Render 2. Update...
@simonedavico @mateuszlazar I've been working hard to fix this, and I have a prerelease ready to test! There aren't huge changes in this version, but the documentation was difficult to...
I've merged and published a new version, `0.9.1`. This includes primarily a new README, which includes new instructions for compatibility with `next/link` in Next 12.2+ & 13+. TL;DR: to mock...