Skip to content

Commit

Permalink
use URLSearchParams to decode and encode query params (#183)
Browse files Browse the repository at this point in the history
* fix parseRoute

* use URLSearchParams to decode and encode query params

* document parseRoute and useMakeLinkWithPreservedPath
  • Loading branch information
tsnobip authored Jan 16, 2025
1 parent 31a300e commit 0add510
Show file tree
Hide file tree
Showing 15 changed files with 513 additions and 107 deletions.
6 changes: 6 additions & 0 deletions .changeset/fresh-shrimps-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@rescript-relay-router-example/client-rendering": patch
"rescript-relay-router": patch
---

fix parseRoute for routes with only query params or only path params
5 changes: 5 additions & 0 deletions .changeset/good-scissors-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"rescript-relay-router": minor
---

use URLSearchParams to decode and encode query params
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
let renderer = Route__Root__Home_route.makeRenderer(
~prepare=({environment}) => {
LayoutQuery_graphql.load(~environment, ~variables=(), ~fetchPolicy=StoreOrNetwork)
},
~render=props => {
<Layout queryRef=props.prepared> {props.childRoutes} </Layout>
},
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
let renderer = Route__Root__PathParamsOnly_route.makeRenderer(
~prepare=({environment}) => {
LayoutQuery_graphql.load(~environment, ~variables=(), ~fetchPolicy=StoreOrNetwork)
},
~render=props => {
<Layout queryRef=props.prepared> {props.childRoutes} </Layout>
},
)

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions examples/client-rendering/src/routes/__generated__/Routes.res

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0add510

Please sign in to comment.