@unitools/navigation
v0.0.1-alpha.0
Published
This is the official documentation of the `@unitools/navigation` package.
Downloads
1,035
Keywords
Readme
@unitools/navigation [ALPHA]
This is the official documentation of the @unitools/navigation
package.
Installation
Install all the dependencies
npm install @unitools/navigation
or
yarn add @unitools/navigation
For Next.js
Add module resolver to your next.config.js
file.
// next.config.js
module.exports = {
webpack(config) {
config.resolve.alias["@unitools/navigation"] = "next/navigation";
return config;
},
};
Usage
import { usePathname, useSearchParams, useRouter } from "@unitools/navigation";
export default function Home() {
// usePathname
const pathname = usePathname();
// useSearchParams
const searchParams = useSearchParams();
const search = searchParams.get("search");
// useRouter
const router = useRouter();
return (
<View>
<Text>About</Text>
</View>
);
}