Skip to content

Commit

Permalink
Undo loader/meta change
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins committed Jan 18, 2024
1 parent f838f6c commit 61e6eeb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/routes/ranger.v1.docs.examples.$.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { useEffect, useState } from 'react'
import type { LoaderFunctionArgs, MetaFunction } from '@remix-run/node'
import type { LoaderFunction, MetaFunction } from '@remix-run/node'
import { json } from '@remix-run/node'
import { useLoaderData } from '@remix-run/react'
import { DocTitle } from '~/components/DocTitle'
import { v1branch } from '~/routes/ranger.v1'
import { seo } from '~/utils/seo'
import { capitalize, slugToTitle } from '~/utils/utils'

export const loader = async (context: LoaderFunctionArgs) => {
export const loader: LoaderFunction = async (context) => {
const { '*': examplePath } = context.params
const [kind, _name] = (examplePath ?? '').split('/')
const [name, search] = _name.split('?')

return json({ kind, name, search: search ?? '' })
}

export const meta: MetaFunction<typeof loader> = ({ data }) => {
export const meta: MetaFunction = ({ data }) => {
return seo({
title: `${capitalize(data.kind)} Ranger ${slugToTitle(
data.name
Expand All @@ -27,7 +27,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
}

export default function RouteReactRangerDocs() {
const { kind, name, search } = useLoaderData<typeof loader>()
const { kind, name, search } = useLoaderData()

const examplePath = [kind, name].join('/')

Expand Down

0 comments on commit 61e6eeb

Please sign in to comment.