Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: docs update to adapte react-router link #12283

Merged
merged 1 commit into from
May 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/docs/docs/guides/routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,11 @@ export default function Page() {

## 路由组件参数

Umi 4 使用 [react-router@6](https://reactrouter.com/docs/en/v6/api) 作为路由组件,路由参数的获取使其 hooks。
Umi 4 使用 [react-router@6](https://reactrouter.com/en/main) 作为路由组件,路由参数的获取使其 hooks。

### match 信息

[useMatch](https://reactrouter.com/docs/en/v6/api#usematch)
[useMatch](https://reactrouter.com/en/main/hooks/use-match)

```jsx
const match = useMatch('/comp/:id')
Expand All @@ -453,7 +453,7 @@ const match = useMatch('/comp/:id')

### location 信息

[useLocation](https://reactrouter.com/docs/en/v6/api#uselocation)
[useLocation](https://reactrouter.com/en/main/hooks/use-location)

```jsx
const location = useLocation();
Expand Down Expand Up @@ -482,7 +482,7 @@ const location = useLocation();

### 路由动态参数

[useParams](https://reactrouter.com/docs/en/v6/api#useparams)
[useParams](https://reactrouter.com/en/main/hooks/use-params)

```jsx
// 路由配置 /comp/:id
Expand All @@ -497,7 +497,7 @@ const params = useParams();

### query 信息

[useSearchParams](https://reactrouter.com/docs/en/v6/api#usesearchparams)
[useSearchParams](https://reactrouter.com/en/main/hooks/use-search-params)

```jsx
// 当前 location /comp?a=b;
Expand Down
Loading