88 useMemo ,
99 useCallback
1010} from 'preact/hooks' ;
11- import { useLocation } from 'preact-iso' ;
11+ import { useRoute } from 'preact-iso' ;
1212import linkState from 'linkstate' ;
1313import { TutorialContext , SolutionContext } from './contexts' ;
1414import cx from '../../../lib/cx' ;
@@ -168,7 +168,7 @@ function TutorialView({
168168
169169 const [ showCodeOverride , toggleCode ] = useReducer ( s => ! s , true ) ;
170170
171- const { url } = useLocation ( ) ;
171+ const { path } = useRoute ( ) ;
172172 const [ lang ] = useLanguage ( ) ;
173173 const { solved } = useContext ( SolutionContext ) ;
174174
@@ -183,7 +183,7 @@ function TutorialView({
183183 if ( ! loading && ! initialLoad ) {
184184 content . current . scrollTo ( 0 , 0 ) ;
185185 }
186- } , [ url , loading , initialLoad ] ) ;
186+ } , [ path , loading , initialLoad ] ) ;
187187
188188 const reRun = useCallback ( ( ) => {
189189 let code = tutorial . state . code ;
@@ -211,7 +211,7 @@ function TutorialView({
211211 < div class = { style . output } key = "output" >
212212 { ! initialLoad && (
213213 < Runner
214- key = { url }
214+ key = { path }
215215 ref = { tutorial . runner }
216216 onSuccess = { tutorial . onSuccess }
217217 onRealm = { tutorial . onRealm }
@@ -226,7 +226,7 @@ function TutorialView({
226226 close
227227 </ button >
228228 < ErrorOverlay
229- key = { 'e:' + url }
229+ key = { 'e:' + path }
230230 class = { style . error }
231231 name = { error . name }
232232 message = { error . message }
@@ -298,7 +298,7 @@ function TutorialView({
298298 </ Splitter >
299299
300300 < InjectPrerenderData
301- name = { url }
301+ name = { path }
302302 data = { {
303303 html,
304304 meta
0 commit comments