Skip to content

Commit c999ef5

Browse files
author
Alex Lohr
committed
type hotfix
1 parent 805c3f7 commit c999ef5

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/index.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,15 @@ function render(ui: Ui, options: Options = {}): Result {
9494
createComponent(Router, {
9595
get children() {
9696
return [
97-
typeof location === "string" ? createComponent(
98-
() => (useNavigate()(location as string, { replace: true, scroll: false }), null),
99-
{}
100-
) : null,
97+
typeof location === "string"
98+
? createComponent(
99+
() => (
100+
useNavigate()(location as string, { replace: true, scroll: false }),
101+
null
102+
),
103+
{}
104+
)
105+
: null,
101106
createComponent(wrappedUi, {})
102107
];
103108
},
@@ -107,9 +112,11 @@ function render(ui: Ui, options: Options = {}): Result {
107112
}
108113
})
109114
};
110-
} catch (e) {
115+
} catch (e: unknown) {
111116
console.error(
112-
`Error attempting to initialize @solidjs/router:\n"${e.message || "unknown error"}"`
117+
`Error attempting to initialize @solidjs/router:\n"${
118+
(e instanceof Error && e.message) || e?.toString() || "unknown error"
119+
}"`
113120
);
114121
return { default: () => createComponent(wrappedUi, {}) };
115122
}

0 commit comments

Comments
 (0)