Unitools | useRouter | By GeekyAnts
This document provides a comprehensive guide on configuring & using the official @unitools/router
package. This configuration is tailored for Expo and Next.js applications, enabling seamless router usage across both frameworks.
For Next.js
Add module resolver to your next.config.js
file.
For Expo
Add module resolver to your babel.config.js
file.
Usage
Props
Name | Type | Default | Description |
---|---|---|---|
push | (path: string) => void | - | Pushes a new entry onto the history stack. |
replace | (path: string) => void | - | Replaces the current entry on the history stack. |
back | () => void | - | Equivalent to go(-1). |
navigate | (path: string) => void | - | Navigate to a specific URL. |