Skip to content

Commit dc488b2

Browse files
mohithshukamohithshuka
authored andcommitted
fix: add missing React imports in invoke-host-binaries example
The React code example was using useState, useEffect, and createDockerDesktopClient without importing them, which would cause errors for anyone copy-pasting the snippet. Fixes #25192
1 parent 552262a commit dc488b2

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

content/manuals/extensions/extensions-sdk/guides/invoke-host-binaries.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2+
3+
4+
5+
6+
17
---
28
title: Invoke host binaries
39
description: Add invocations to host binaries from the frontend with the extension
@@ -70,8 +76,12 @@ In this example, the binary returns a string as result, obtained by `result?.std
7076
{{< tab name="React" >}}
7177

7278
```typescript
79+
import React, { useState, useEffect } from 'react';
80+
import { createDockerDesktopClient } from '@docker/extension-api-client';
81+
82+
const ddClient = createDockerDesktopClient();
83+
7384
export function App() {
74-
const ddClient = createDockerDesktopClient();
7585
const [hello, setHello] = useState("");
7686

7787
useEffect(() => {

0 commit comments

Comments
 (0)