Skip to content

Commit 12de1b0

Browse files
committed
Update docs to reference @trigger.dev/react@latest instead of @next
1 parent b62df73 commit 12de1b0

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

docs/documentation/guides/react-hooks.mdx

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ Add the `@trigger.dev/react` package to your project:
2020
<CodeGroup>
2121

2222
```bash npm
23-
npm install @trigger.dev/react@next
23+
npm install @trigger.dev/react@latest
2424
```
2525

2626
```bash pnpm
27-
pnpm install @trigger.dev/react@next
27+
pnpm install @trigger.dev/react@latest
2828
```
2929

3030
```bash yarn
31-
yarn add @trigger.dev/react@next
31+
yarn add @trigger.dev/react@latest
3232
```
3333

3434
</CodeGroup>
@@ -42,9 +42,9 @@ In the Trigger.dev dashboard you should go to your Project and then the "Environ
4242
You should copy the `PUBLIC` API key for the dev environment.
4343

4444
<Accordion title="What's a public API key?">
45-
A public API key is a key that can be used in the browser. It can only be used
46-
to read certain data from the API and can not write data. This means that it
47-
can be used to get the status of a Job Run, but not to start a new Job Run.
45+
A public API key is a key that can be used in the browser. It can only be used to read certain
46+
data from the API and can not write data. This means that it can be used to get the status of a
47+
Job Run, but not to start a new Job Run.
4848
</Accordion>
4949

5050
### 3. Add the env var to your project
@@ -67,17 +67,11 @@ The [TriggerProvider](/sdk/react/triggerprovider) component is a React Context P
6767
Generally you'll want to add this to the root of your app, so that it's available everywhere. However, you can add it lower in the hierarchy but it must be above any of the hooks.
6868

6969
```tsx app/layout.tsx
70-
export default function RootLayout({
71-
children,
72-
}: {
73-
children: React.ReactNode;
74-
}) {
70+
export default function RootLayout({ children }: { children: React.ReactNode }) {
7571
return (
7672
<html lang="en">
7773
<body className={inter.className}>
78-
<TriggerProvider
79-
publicApiKey={process.env.NEXT_PUBLIC_TRIGGER_API_KEY!}
80-
>
74+
<TriggerProvider publicApiKey={process.env.NEXT_PUBLIC_TRIGGER_API_KEY!}>
8175
{children}
8276
</TriggerProvider>
8377
</body>
@@ -141,9 +135,9 @@ export default function EventDetails({ eventId }: { eventId: string }) {
141135
The `useRunDetails` hook will get the details of a specific Run. You can use this to show the status of a specific Run.
142136

143137
<Accordion title="How do I get a Run id?">
144-
You can call [client.getRuns()](/sdk/triggerclient/instancemethods/getruns)
145-
with a Job id to get a list of the most recent Runs for that Job. You can then
146-
pass that run id to your frontend to use in the hook.
138+
You can call [client.getRuns()](/sdk/triggerclient/instancemethods/getruns) with a Job id to get a
139+
list of the most recent Runs for that Job. You can then pass that run id to your frontend to use
140+
in the hook.
147141
</Accordion>
148142

149143
This component will show the details of a Run and the status of each task in the Run:

0 commit comments

Comments
 (0)