Skip to content

Commit 95a736e

Browse files
authored
Fix: correct TypeScript in example snippet
1 parent 66bc1d7 commit 95a736e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/content/docs/workers/framework-guides/web-apps/react-router.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ As you have direct access to your Worker entry file (`workers/app.ts`), you can
132132

133133
```ts title="workers/app.ts"
134134
import { createRequestHandler } from "react-router";
135-
import { WorkflowEntrypoint, WorkflowStep, WorkflowEvent } from 'cloudflare:workers';
135+
import { WorkflowEntrypoint, WorkflowStep, type WorkflowEvent } from 'cloudflare:workers';
136136

137137
declare global {
138138
interface CloudflareEnvironment extends Env {}
@@ -188,7 +188,8 @@ As you have direct access to your Worker entry file (`workers/app.ts`), you can
188188
And then use it in your application:
189189

190190
```ts title="app/routes/home.tsx"
191-
export function action({ context }: Route.LoaderArgs) {
191+
export async function action({ context }: Route.LoaderArgs) {
192+
const env = context.cloudflare.env;
192193
const instance = await env.MY_WORKFLOW.create({ params: { "hello": "world" })
193194
return { id: instance.id, details: instance.status() };
194195
}

0 commit comments

Comments
 (0)