next.js
310597bb - Lift public router instance to module level (#77426)

Commit
310 days ago
Lift public router instance to module level (#77426) There's only one instance for the whole app, and it conceptually lives outside of the React tree. We don't need to create it during render. The intent here is also to provide a clearer separation between the public router interface (returned by `useRouter`) and internal routing implementation used by Next.js itself, e.g. in the Link component. Right now, most internals go through the public interface, but going forward we should call the lower level methods directly. This helps prevent implementation details from accidentally leaking into public APIs.
Author
Parents
Loading