File tree 2 files changed +4
-4
lines changed
pages/TemplateVersionPage
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { useSearchParams } from "react-router-dom"
2
2
3
3
export interface UseTabResult {
4
- value : string | null
4
+ value : string
5
5
set : ( value : string ) => void
6
6
}
7
7
8
- export const useTab = ( tabKey : string ) : UseTabResult => {
8
+ export const useTab = ( tabKey : string , defaultValue : string ) : UseTabResult => {
9
9
const [ searchParams , setSearchParams ] = useSearchParams ( )
10
- const value = searchParams . get ( tabKey )
10
+ const value = searchParams . get ( tabKey ) ?? defaultValue
11
11
12
12
return {
13
13
value,
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export const TemplateVersionPage: FC = () => {
20
20
const [ state ] = useMachine ( templateVersionMachine , {
21
21
context : { versionName, orgId } ,
22
22
} )
23
- const tab = useTab ( "file" )
23
+ const tab = useTab ( "file" , "0" )
24
24
const { t } = useTranslation ( "templateVersionPage" )
25
25
26
26
return (
You can’t perform that action at this time.
0 commit comments