Initial commit
This commit is contained in:
commit
78f8d225ee
21173 changed files with 2907774 additions and 0 deletions
16
node_modules/next/dist/esm/client/compat/router.js
generated
vendored
Normal file
16
node_modules/next/dist/esm/client/compat/router.js
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { useContext } from 'react';
|
||||
import { RouterContext } from '../../shared/lib/router-context.shared-runtime';
|
||||
/**
|
||||
* useRouter from `next/compat/router` is designed to assist developers
|
||||
* migrating from `pages/` to `app/`. Unlike `next/router`, this hook does not
|
||||
* throw when the `NextRouter` is not mounted, and instead returns `null`. The
|
||||
* more concrete return type here lets developers use this hook within
|
||||
* components that could be shared between both `app/` and `pages/` and handle
|
||||
* to the case where the router is not mounted.
|
||||
*
|
||||
* @returns The `NextRouter` instance if it's available, otherwise `null`.
|
||||
*/ export function useRouter() {
|
||||
return useContext(RouterContext);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=router.js.map
|
||||
1
node_modules/next/dist/esm/client/compat/router.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/client/compat/router.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../../src/client/compat/router.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { RouterContext } from '../../shared/lib/router-context.shared-runtime'\nimport type { NextRouter } from '../router'\n\n/**\n * useRouter from `next/compat/router` is designed to assist developers\n * migrating from `pages/` to `app/`. Unlike `next/router`, this hook does not\n * throw when the `NextRouter` is not mounted, and instead returns `null`. The\n * more concrete return type here lets developers use this hook within\n * components that could be shared between both `app/` and `pages/` and handle\n * to the case where the router is not mounted.\n *\n * @returns The `NextRouter` instance if it's available, otherwise `null`.\n */\nexport function useRouter(): NextRouter | null {\n return useContext(RouterContext)\n}\n"],"names":["useContext","RouterContext","useRouter"],"mappings":"AAAA,SAASA,UAAU,QAAQ,QAAO;AAClC,SAASC,aAAa,QAAQ,iDAAgD;AAG9E;;;;;;;;;CASC,GACD,OAAO,SAASC;IACd,OAAOF,WAAWC;AACpB"}
|
||||
Loading…
Add table
Add a link
Reference in a new issue