Skip to content

Commit

Permalink
Merge pull request #1312 from paularmstrong/fix-error-boundary-issue
Browse files Browse the repository at this point in the history
fix: ensure ParentProps is declared as a type import
  • Loading branch information
ryansolid authored Feb 7, 2024
2 parents 20697ed + 4d66b4d commit 4b9f236
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-eggs-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/start": patch
---

Fixed an issue with TypeScript based projects throwing client side errors regarding a type input in the `ErrorBoundary`.wq
17 changes: 3 additions & 14 deletions packages/start/shared/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
import {
ErrorBoundary as DefaultErrorBoundary,
ParentProps,
} from "solid-js";
import { ErrorBoundary as DefaultErrorBoundary, type ParentProps } from "solid-js";
import { HttpStatusCode } from "./HttpStatusCode";
import { DevOverlay } from "./dev-overlay";

export function ErrorBoundary(props: ParentProps) {
if (import.meta.env.DEV) {
return (
<DevOverlay>
{props.children}
</DevOverlay>
);
return <DevOverlay>{props.children}</DevOverlay>;
}
return (
<DefaultErrorBoundary
fallback={(
<HttpStatusCode code={500} />
)}
>
<DefaultErrorBoundary fallback={<HttpStatusCode code={500} />}>
{props.children}
</DefaultErrorBoundary>
);
Expand Down

0 comments on commit 4b9f236

Please sign in to comment.