Skip to content

Commit

Permalink
handle missing component
Browse files Browse the repository at this point in the history
  • Loading branch information
dalurness committed Nov 8, 2024
1 parent 20e733a commit 9d25210
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/components/DynamicSolution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ let x: Record<string, astroHTML.JSX.Element> = import.meta.glob('./solutions/*',
export function DynamicSolution({ resultComponent }: { resultComponent: string }) {
let path = `./solutions/${resultComponent}.tsx`
let Component = x[path]

if (!Component) return null

return (
<Component client:load />
)
Expand Down
5 changes: 0 additions & 5 deletions src/components/solutions/2.tsx

This file was deleted.

0 comments on commit 9d25210

Please sign in to comment.