Commit a60da574 authored by Lukáš Huvar's avatar Lukáš Huvar Committed by Joe Haddad

Clarify params and query merging (#7744)

* Clarify params and query merging

* Tweak README per @ijjk
parent b2a9670c
......@@ -298,6 +298,9 @@ The matched path parameter will be sent as a query parameter to the page.
For example, the route `/post/1` will have the following `query` object: `{ pid: '1' }`.
Similarly, the route `/post/abc?foo=bar` will have the `query` object: `{ foo: 'bar', pid: 'abc' }`.
However, if a query and route param name are the same, route parameters will override the matching query params.
For example, `/post/abc?pid=bcd` will have the `query` object: `{ pid: 'abc' }`.
> **Note**: Predefined routes take precedence over dynamic routes.
> For example, if you have `pages/post/[pid].js` and `pages/post/create.js`, the route `/post/create` will be matched by `pages/post/create.js` instead of the dynamic route (`[pid]`).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment