Skip to content

Commit

Permalink
less ideal solution but the wasPush test succeeds
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Sep 8, 2021
1 parent dc6d873 commit 79dffba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/preact-iso/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export function LocationProvider(props) {
const RESOLVED = Promise.resolve();

export function Router(props) {
const [c, update] = useReducer(c => c + 1, 0);
const [, update] = useReducer(c => c + 1, 0);

const { url, query, wasPush, path } = useLocation();
const { rest = path, params = {} } = useContext(RouteContext);
Expand Down Expand Up @@ -180,7 +180,7 @@ export function Router(props) {
if (wasPush) scrollTo(0, 0);
if (props.onLoadEnd && isLoading.current) props.onLoadEnd(url);
isLoading.current = false;
}, [c]);
});

// Note: curChildren MUST render first in order to set didSuspend & prev.
return [h(RenderRef, { r: cur }), h(RenderRef, { r: prev })];
Expand Down

0 comments on commit 79dffba

Please sign in to comment.