Skip to content

Commit

Permalink
Merge pull request #35 from tordans/patch-1
Browse files Browse the repository at this point in the history
Docs: Extend search params section
  • Loading branch information
togetherAll7 authored May 19, 2024
2 parents 8d9ceab + 31b90d7 commit ae5ca3a
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,20 @@ router.get() //=> {
// }
```

To use search query like `?a=1&b=2` in routes you need to set `search` option:
To disable the automatic parsing of search params in routes you need to set `search` option.
Router will now treat search query like `?a=1&b=2` as a string. Parameters order will be critical.

```js
createRouter(
{
home: '/p/?page=home'
},
{
search: true
}
)
```
createRouter({ home: '/posts?page=general' }, { search: true })

Router will work with `?search` part as a string. Parameters order will
be critical.
location.href = '/posts/?page=general'
router.get() //=> {
// path: '/posts?page=general',
// route: 'list',
// params: { },
// search: { }
// }
```

### Clicks Tracking

Expand Down

0 comments on commit ae5ca3a

Please sign in to comment.