scottrippey / next-router-mock

Mock implementation of the Next.js Router
MIT License
400 stars 38 forks source link

Use async singleton router for MemoryRouterProvider #114

Closed tom-streller-tutti closed 9 months ago

tom-streller-tutti commented 10 months ago

We are using the next-router-mock/async provider and had a bunch of issues with the Provider, as it appeared all manipulations of the router get ignored by our components.

Looking into the code, I discovered why: The <MemoryRouterProvider /> ignores the async prop unless an url is given. However, when an url is given, a new router is created.

This should return the async singleton when requested - however, I could not test if it works for our application as I couldn't figure out how to include the package without it being published.

changeset-bot[bot] commented 10 months ago

🦋 Changeset detected

Latest commit: d2e8fffadfbdc15593593c8306cfa53b8f8e4e63

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ---------------- | ----- | | next-router-mock | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

tom-streller-tutti commented 10 months ago

Merging this PR would also fix issue #111 .

tom-streller-tutti commented 10 months ago

@scottrippey Any chance of getting this merged? It's currently blocking a crucial update for us.