File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -104,12 +104,13 @@ export type PathParams = {
104
104
105
105
export type ParseRegexpPathParamsOptions = {
106
106
excludeNames ?: string [ ]
107
+ forceExcludeNames ?: string [ ]
107
108
}
108
109
export const parseRegexpPathParams = (
109
110
regexpPath : string ,
110
111
options ?: ParseRegexpPathParamsOptions ,
111
112
) => {
112
- const { excludeNames = [ ] } = options || { }
113
+ const { excludeNames = [ ] , forceExcludeNames = [ ] } = options || { }
113
114
const transformedPath = transformUriPath ( regexpPath )
114
115
const { tokens } = parse ( transformedPath )
115
116
@@ -151,7 +152,8 @@ export const parseRegexpPathParams = (
151
152
( item ) =>
152
153
typeof item === "object" &&
153
154
"name" in item &&
154
- ( ! excludeNames . includes ( item . name ) || ! item . optional ) ,
155
+ ( ! excludeNames . includes ( item . name ) || ! item . optional ) &&
156
+ ! forceExcludeNames . includes ( item . name ) ,
155
157
) as PathParams [ ]
156
158
}
157
159
export const parseFullPathParams = ( path : string , regexpPath : string ) => {
Original file line number Diff line number Diff line change @@ -122,8 +122,9 @@ export const DiscoverFeedForm = ({
122
122
"lang" ,
123
123
"sort" ,
124
124
] ,
125
+ forceExcludeNames : routeParams ? [ "routeParams" ] : [ ] ,
125
126
} ) ,
126
- [ route . path ] ,
127
+ [ route . path , routeParams ] ,
127
128
)
128
129
129
130
const formPlaceholder = useMemo < Record < string , string > > ( ( ) => {
You can’t perform that action at this time.
0 commit comments