Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/solid-router/basic-file-based/tests/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ test('Should change post navigating back and forth', async ({ page }) => {
await expect(page.getByTestId('post-title')).toContainText('sunt aut facere')
})

test.skip('Should not remount deps when remountDeps does not change ', async ({
test('Should not remount deps when remountDeps does not change ', async ({
page,
}) => {
await page.goto('/notRemountDeps')
Expand Down
19 changes: 12 additions & 7 deletions packages/solid-router/src/Match.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,19 +222,22 @@ export const MatchInner = (props: { matchId: string }): any => {

const match = () => matchState().match

const componentKey = () => matchState().key ?? matchState().match.id

const out = () => {
const Comp = route().options.component ?? router.options.defaultComponent
if (Comp) {
const key = matchState().key ?? matchState().match.id
return (
<Solid.Show when={key} keyed>
<Comp />
</Solid.Show>
)
return <Comp />
}
return <Outlet />
}

const keyedOut = () => (
<Solid.Show when={componentKey()} keyed>
{(_key) => out()}
</Solid.Show>
)

return (
<Solid.Switch>
<Solid.Match when={match()._displayPending}>
Expand Down Expand Up @@ -327,7 +330,9 @@ export const MatchInner = (props: { matchId: string }): any => {
throw match().error
}}
</Solid.Match>
<Solid.Match when={match().status === 'success'}>{out()}</Solid.Match>
<Solid.Match when={match().status === 'success'}>
{keyedOut()}
</Solid.Match>
</Solid.Switch>
)
}
Expand Down
Loading