File: content/manuals/extensions/extensions-sdk/build/backend-extension-tutorial.md
Issue
The React code example in the "Invoke the extension backend from your frontend" section uses the useState hook but doesn't import it, which would cause a compilation error.
The import statement (line ~240):
import React, { useEffect } from 'react';
But the code uses useState (line ~248):
const [hello, setHello] = useState<string>();
Additionally, the code declares ddClient twice - once outside the component and once inside, which is redundant:
const ddClient = createDockerDesktopClient(); // Line ~244
export function App() {
const ddClient = createDockerDesktopClient(); // Line ~247 - redundant
Why this matters
A developer copying this code would get a compilation error: 'useState' is not defined. The code won't run until they figure out the missing import. The duplicate ddClient declaration, while not causing an error, adds confusion about the correct pattern.
Suggested fix
Update the import statement to include useState:
import React, { useEffect, useState } from 'react';
And remove the duplicate ddClient declaration inside the App function, keeping only the one outside (or vice versa, depending on the intended pattern).
Found by nightly documentation quality scanner
File:
content/manuals/extensions/extensions-sdk/build/backend-extension-tutorial.mdIssue
The React code example in the "Invoke the extension backend from your frontend" section uses the
useStatehook but doesn't import it, which would cause a compilation error.The import statement (line ~240):
But the code uses
useState(line ~248):Additionally, the code declares
ddClienttwice - once outside the component and once inside, which is redundant:Why this matters
A developer copying this code would get a compilation error:
'useState' is not defined. The code won't run until they figure out the missing import. The duplicateddClientdeclaration, while not causing an error, adds confusion about the correct pattern.Suggested fix
Update the import statement to include
useState:And remove the duplicate
ddClientdeclaration inside theAppfunction, keeping only the one outside (or vice versa, depending on the intended pattern).Found by nightly documentation quality scanner