11import * as React from 'react'
22import { create } from 'zustand'
3- import { useLocation , useNavigate , useParams } from '@tanstack/react-router'
3+ import { useNavigate , useParams } from '@tanstack/react-router'
44import { useQueryClient } from '@tanstack/react-query'
55import { Select } from './Select'
66import { Framework , getLibrary , LibraryId } from '~/libraries'
@@ -123,7 +123,6 @@ function useFrameworkConfig({ frameworks }: { frameworks: Framework[] }) {
123123 */
124124export function useCurrentFramework ( frameworks : Framework [ ] ) {
125125 const navigate = useNavigate ( )
126- const location = useLocation ( )
127126 const userQuery = useCurrentUserQuery ( )
128127 const queryClient = useQueryClient ( )
129128
@@ -144,6 +143,9 @@ export function useCurrentFramework(frameworks: Framework[]) {
144143
145144 const setFramework = React . useCallback (
146145 ( framework : string ) => {
146+ navigate ( {
147+ params : { framework } as any ,
148+ } )
147149 // Always update localStorage as fallback
148150 localCurrentFramework . setCurrentFramework ( framework )
149151 queryClient . setQueryData ( currentUserQueryOptions . queryKey , ( user ) =>
@@ -155,7 +157,7 @@ export function useCurrentFramework(frameworks: Framework[]) {
155157 persistFrameworkToServer ( framework )
156158 }
157159 } ,
158- [ localCurrentFramework , queryClient , userQuery . data ] ,
160+ [ localCurrentFramework , navigate , queryClient , userQuery . data ] ,
159161 )
160162
161163 React . useEffect ( ( ) => {
0 commit comments