Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

The designer-modes example was failing CI type checks with TS6133 (unused React import) and TS2307 (CSS module not found).

Changes

  • App.tsx: Remove unnecessary React namespace import (automatic JSX runtime doesn't require it)
  • main.tsx: Use named imports (StrictMode, createRoot) instead of namespace imports
  • tsconfig.json: Add "types": ["vite/client"] for CSS import type definitions
-import React, { useState } from 'react';
+import { useState } from 'react';

-import React from 'react';
-import ReactDOM from 'react-dom/client';
+import { StrictMode } from 'react';
+import { createRoot } from 'react-dom/client';

The tsconfig already specified "jsx": "react-jsx" which enables automatic JSX transformation, making the React namespace import redundant. Vite client types are required for module declarations like CSS imports.

Original prompt

引用: https://github.com/objectstack-ai/objectui/actions/runs/21026040003/job/60450980468#step:6:1


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Remove unnecessary React import from App.tsx (jsx: react-jsx handles JSX automatically)
- Update main.tsx to use named imports instead of namespace import
- Add vite/client types to tsconfig for CSS import support

Fixes TS6133 and TS2307 errors that were causing CI build failures

Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Copilot AI changed the title [WIP] Update action run parameters for better clarity Fix TypeScript errors in designer-modes example Jan 15, 2026
Copilot AI requested a review from huangyiirene January 15, 2026 09:32
@huangyiirene huangyiirene requested review from Copilot and removed request for huangyiirene January 15, 2026 09:35
Copy link
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

This PR fixes TypeScript compilation errors in the designer-modes example that were causing CI failures. The changes modernize the React imports to align with the automatic JSX runtime configuration and add missing type definitions for Vite's module resolution.

Changes:

  • Removed redundant React namespace imports in favor of named imports
  • Added Vite client types to tsconfig for CSS module declarations

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
examples/designer-modes/tsconfig.json Added "types": ["vite/client"] to resolve CSS import type errors
examples/designer-modes/src/main.tsx Changed to named imports (StrictMode, createRoot) instead of namespace imports
examples/designer-modes/src/App.tsx Removed unused React namespace import, keeping only useState

@huangyiirene
Copy link
Contributor

@copilot fix check

@huangyiirene
Copy link
Contributor

@copilot fix type check

Copilot AI and others added 2 commits January 15, 2026 09:41
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
@github-actions
Copy link

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

@huangyiirene huangyiirene marked this pull request as ready for review January 15, 2026 10:25
@huangyiirene huangyiirene merged commit 1714bfc into copilot/fix-action-run-issue Jan 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants