Skip to content

Commit

Permalink
Merge pull request #1338 from lpsinger/name-ref-null
Browse files Browse the repository at this point in the history
Infer useLoaderData type, handle corner cases where things are null
  • Loading branch information
dakota002 authored Sep 7, 2023
2 parents 00dd4b3 + 3f01901 commit 58cfa04
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/routes/docs_.schema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function Schema() {
if (!path) throw new Error('Path is not defined.')

const [showVersions, setShowVersions] = useState(false)
const { versions } = useLoaderData()
const { versions } = useLoaderData<typeof loader>()
const windowSize = useWindowSize()
const isSchema = path.endsWith('.schema.json')

Expand Down Expand Up @@ -75,13 +75,13 @@ export default function Schema() {
<h3>Versions</h3>
</CardHeader>
<CardBody className="padding-y-0">
{versions.map((x: { name: string; ref: string }) => (
<div key={x.name}>
{versions.map(({ name, ref }) => (
<div key={ref}>
<Link
to={`/docs/schema/${x.ref}/${path}`}
to={`/docs/schema/${ref}/${path}`}
onClick={() => setShowVersions(!setShowVersions)}
>
{x.name}
{name || ref}
</Link>
</div>
))}
Expand Down

0 comments on commit 58cfa04

Please sign in to comment.