Skip to content

fix: add missing React imports in invoke-host-binaries code example#25218

Open
mohithshuka wants to merge 7 commits into
docker:mainfrom
mohithshuka:fix/missing-usestate-import-25192
Open

fix: add missing React imports in invoke-host-binaries code example#25218
mohithshuka wants to merge 7 commits into
docker:mainfrom
mohithshuka:fix/missing-usestate-import-25192

Conversation

@mohithshuka
Copy link
Copy Markdown
Contributor

Summary

Fixes #25192

The React code example in invoke-host-binaries.md was using useState,
useEffect, and createDockerDesktopClient without importing them.
Anyone copying this snippet would get runtime errors.

Changes

  • Added import React, { useState, useEffect } from 'react'
  • Added import { createDockerDesktopClient } from '@docker/extension-api-client'
  • Moved createDockerDesktopClient() call to module level (consistent
    with backend-extension-tutorial.md pattern)

Testing

  • Verified the code block now has all required imports
  • Pattern matches the existing backend extension tutorial example

mohithshuka added 7 commits May 15, 2026 16:36
The previous description said 'optimize your repository storage' which
was vague and did not reflect the page's actual content. The manage.md
page is focused on viewing, filtering, and deleting images and image
indexes. Updated the description to accurately reflect this.

Fixes docker#25005
The daemon configuration overview only mentioned two methods (JSON file
and flags) but was missing the environment variables method via systemd.
Added a new section explaining how to use systemd drop-in overrides to
set daemon environment variables.

Fixes docker#25062
Replace shorthand alias 'docker scout env' with the full canonical
command name 'docker scout environment' in the environment integration
overview page, matching the CLI reference and cli.md usage.

Closes docker#25085
The _index.md page mixed 'docker scout env' and 'docker scout environment'
interchangeably. The CLI reference uses 'environment' as the canonical
name, so prose references are updated to match.

Fixes docker#25085
…ct example

Fixes docker#25192

useState was used on line 286 but was missing from the import statement,
causing an error if users follow the tutorial literally.
The React code example was using useState, useEffect, and
createDockerDesktopClient without importing them, which would
cause errors for anyone copy-pasting the snippet.

Fixes docker#25192
Copilot AI review requested due to automatic review settings May 30, 2026 18:19
@netlify
Copy link
Copy Markdown

netlify Bot commented May 30, 2026

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit dc488b2
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/6a1b2a439397cc0008750a93
😎 Deploy Preview https://deploy-preview-25218--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added area/engine Issue affects Docker engine/daemon area/extensions Relates to Docker Extensions area/scout Relates to Docker Scout labels May 30, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates documentation across Scout, Extensions SDK, and Engine daemon guides to reflect CLI changes and expand daemon configuration guidance.

Changes:

  • Replace docker scout env references with docker scout environment in Scout environment docs.
  • Update Extensions SDK docs to move createDockerDesktopClient() initialization and adjust imports.
  • Add a new section describing Docker daemon configuration via environment variables.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
content/manuals/scout/integrations/environment/_index.md Updates Scout CLI command references and examples for environment management.
content/manuals/extensions/extensions-sdk/guides/invoke-host-binaries.md Adjusts guide formatting and React example initialization pattern.
content/manuals/extensions/extensions-sdk/build/backend-extension-tutorial.md Updates React import list in tutorial snippet.
content/manuals/engine/daemon/_index.md Expands daemon configuration docs with an environment-variable-based approach and systemd steps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -52,15 +52,15 @@ To see all of the available environments for an organization, you can use the
`docker scout env` command.
Comment on lines +101 to +102
Alternatively, you can Use the `docker scout environment` command to view the images from the terminal.
use the `docker scout environment` command to view the images from the terminal.
Comment on lines +1 to 9






---
title: Invoke host binaries
description: Add invocations to host binaries from the frontend with the extension
Comment on lines +40 to 48
There are three ways to configure the Docker daemon:

- Use a JSON configuration file. This is the preferred option, since it keeps
all configurations in a single place.
- Use flags when starting `dockerd`.
- Use environment variables to set daemon options.

You can use both of these options together as long as you don't specify the same
option both as a flag and in the JSON file. If that happens, the Docker daemon
Comment on lines +96 to +99
### Configuration using environment variables

You can configure the Docker daemon using environment variables. This is useful
in systemd service overrides or init scripts.

To set environment variables for the Docker daemon using systemd, create a
drop-in override file:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/engine Issue affects Docker engine/daemon area/extensions Relates to Docker Extensions area/scout Relates to Docker Scout

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docs-scanner] Missing useState import in backend extension React example

2 participants