Skip to content

Commit

Permalink
Merge pull request #204 from Tlaster/bugfix/group_route_path
Browse files Browse the repository at this point in the history
disable path matching for group route
  • Loading branch information
Tlaster authored Dec 4, 2023
2 parents 3a3f55d + 60bf060 commit 15dfc8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/component/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ Optional syntax is also supported for regex path variable: `/user/{id:[0-9]+}?`:
- matches `/user/123`

### Group
Note: group's `route` and `initialRoute` does not support path variable and regex, only static route is supported.
```kotlin
group(route = "/group", initialRoute = "/nestedScreen1") {
scene(route = "/nestedScreen1") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ class RouteBuilder(
initialRoute: String,
content: RouteBuilder.() -> Unit,
) {
require(!route.contains("{")) { "GroupRoute does not support path matching" }
require(!initialRoute.contains("{")) { "GroupRoute does not support path matching" }
content.invoke(this)
val actualInitialRoute = this.route.firstOrNull { it.route == initialRoute }
?: throw IllegalArgumentException("Initial route $initialRoute not found")
Expand Down

0 comments on commit 15dfc8e

Please sign in to comment.