Skip to content

Commit ded5ba6

Browse files
committed
PR feedback
1 parent 690261f commit ded5ba6

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

docs/open-source/react-quickstart.mdx

+10-8
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ uvicorn main:app --port 3000
5656

5757
You now have a server with a Vocode websocket route at localhost:3000! You can now use the `useConversation` hook with your self-hosted backend as follows:
5858

59-
```javascript
59+
```typescript
60+
import { useConversation } from "vocode";
61+
6062
const { status, start, stop, error, analyserNode } = useConversation({
6163
backendUrl: "<YOUR_BACKEND_URL>", // looks like ws://localhost:3000/conversation or wss://asdf1234.ngrok.app/conversation if using ngrok
6264
audioDeviceConfig: {},
@@ -65,14 +67,14 @@ const { status, start, stop, error, analyserNode } = useConversation({
6567

6668
Use the `status`, `start`, and `stop` objects within your React components to control conversations with your self-hosted backend, e.g.
6769

68-
```
70+
```jsx
6971
<>
70-
{status === "idle" && <p>Press me to talk!</p>}
71-
{status == "error" && error && <p>{error.message}</p>}
72+
{status === "idle" && <p>Press me to talk!</p>}
73+
{status == "error" && error && <p>{error.message}</p>}
7274

73-
<button
74-
disabled={["connecting"].includes(status)}
75-
onClick={status === "connected" ? stop : start}
76-
></button>
75+
<button
76+
disabled={["connecting"].includes(status)}
77+
onClick={status === "connected" ? stop : start}
78+
></button>
7779
</>
7880
```

0 commit comments

Comments
 (0)