Skip to content

Commit

Permalink
fix: minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
swernerx committed Feb 3, 2023
1 parent 6751acf commit f095b74
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/react-router/src/routes/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ const fakeData: Record<string, any> = {
}

export async function Loader({ params }: LoaderFunctionArgs): Promise<LoaderResult> {
console.log("Loader Params:", params)
console.log("Loader: Router Params:", params)

// This could be any `fetch()` which loads data from a remote
await sleep(500)
return fakeData
}

export async function Action({ request }: ActionFunctionArgs) {
export async function Action({ request, params }: ActionFunctionArgs) {
console.log("Action: Router Params:", params)

const formData = await request.formData();
for (const [name, value] of formData) {
fakeData[name] = value
Expand Down

0 comments on commit f095b74

Please sign in to comment.