Skip to content

Commit edee994

Browse files
Update src/content/docs/workers/frameworks/framework-guides/react-router.mdx
Co-authored-by: Greg Brimble <[email protected]>
1 parent 24455b6 commit edee994

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,27 @@ As you have direct access to your Worker entry file (`workers/app.ts`), you can
169169
} satisfies ExportedHandler<CloudflareEnvironment>;
170170
```
171171

172+
Configure it in your Wrangler configuration file:
173+
174+
<WranglerConfig>
175+
176+
```toml
177+
[[workflows]]
178+
name = "my-workflow"
179+
binding = "MY_WORKFLOW"
180+
class_name = "MyWorkflow"
181+
```
182+
183+
</WranglerConfig>
184+
185+
And then using it in your application:
186+
187+
```ts title="app/routes/home.tsx"
188+
export function action({ context }: Route.LoaderArgs) {
189+
const instance = await env.MY_WORKFLOW.create({ params: { "hello": "world" })
190+
return { id: instance.id, details: instance.status() };
191+
}
192+
```
172193
</Details>
173194
174195
<Render file="frameworks-bindings" />

0 commit comments

Comments
 (0)