-
Notifications
You must be signed in to change notification settings - Fork 660
Fix TS problems and make TS improvements in demos (Editors) - part 3 #32021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 25_2
Are you sure you want to change the base?
Fix TS problems and make TS improvements in demos (Editors) - part 3 #32021
Conversation
There was a problem hiding this 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 enhances TypeScript type safety and consistency in React demos for Editor components (part 3), covering Switch, TagBox, TextArea, TextBox, Toast, Tooltip, and Validation demos. The changes add these demos to tsconfig.react-check.json for type checking and implement TypeScript best practices throughout.
Key improvements include:
- Separating type imports from value imports using
import typesyntax - Adding explicit type annotations to state variables and function parameters
- Removing unnecessary setState setters from useCallback/useMemo dependency arrays
- Replacing
React.Fragmentwith the<>shorthand syntax - Improving component prop destructuring patterns
- Creating dedicated type definition files for better code organization
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/demos/tsconfig.react-check.json | Adds Switch, TagBox, TextArea, TextBox, Toast, Tooltip, and Validation demo paths for TypeScript checking |
| apps/demos/Demos/Validation/Overview/ReactJs/App.js | Removes setState setters from useCallback dependency arrays (best practice) |
| apps/demos/Demos/Validation/Overview/React/App.tsx | Adds comprehensive type annotations, separates type imports, and improves function signatures; contains useMemo syntax errors |
| apps/demos/Demos/Tooltip/Overview/React/App.tsx | Replaces deprecated ITooltipOptions with TooltipTypes.Properties |
| apps/demos/Demos/Toast/Stack/ReactJs/App.js | Removes setState setters from dependency arrays and replaces React.Fragment with <> |
| apps/demos/Demos/Toast/Stack/React/types.ts | Adds NotifyStack type definition extracted from Notify function |
| apps/demos/Demos/Toast/Stack/React/data.ts | Adds proper type annotations to exported data arrays |
| apps/demos/Demos/Toast/Stack/React/App.tsx | Adds comprehensive types, improves callback signatures, uses SelectBox event destructuring |
| apps/demos/Demos/Toast/Overview/ReactJs/ProductItem.js | Improves prop destructuring and dependency arrays |
| apps/demos/Demos/Toast/Overview/ReactJs/App.js | Removes setState setters from dependency arrays |
| apps/demos/Demos/Toast/Overview/React/types.ts | Adds Product and ToastConfig type definitions |
| apps/demos/Demos/Toast/Overview/React/data.ts | Adds Product type annotation to products array |
| apps/demos/Demos/Toast/Overview/React/ProductItem.tsx | Adds proper type annotations and improves prop destructuring |
| apps/demos/Demos/Toast/Overview/React/App.tsx | Adds comprehensive type annotations and improves callback typing |
| apps/demos/Demos/TextBox/Overview/React/App.tsx | Adds type annotations and separates type imports |
| apps/demos/Demos/TextArea/Overview/ReactJs/data.js | Refactors from default export object to named exports |
| apps/demos/Demos/TextArea/Overview/ReactJs/App.js | Updates to use named imports and replaces React.Fragment with <> |
| apps/demos/Demos/TextArea/Overview/React/types.ts | Adds ValueChangeEvent type definition |
| apps/demos/Demos/TextArea/Overview/React/data.ts | Refactors to named exports with proper types |
| apps/demos/Demos/TextArea/Overview/React/App.tsx | Adds comprehensive type annotations and improves callback signatures |
| apps/demos/Demos/TagBox/TagCountLimitation/React/types.ts | Adds Product type definition with nullable Current_Inventory |
| apps/demos/Demos/TagBox/TagCountLimitation/React/data.ts | Adds Product type annotation to products array |
| apps/demos/Demos/TagBox/TagCountLimitation/React/App.tsx | Adds type annotations and uses satisfies for type safety |
| apps/demos/Demos/TagBox/Overview/ReactJs/Tag.js | Replaces React.Fragment with <> |
| apps/demos/Demos/TagBox/Overview/ReactJs/App.js | Fixes product state initialization from {} to null |
| apps/demos/Demos/TagBox/Overview/React/types.ts | Adds Product type definition (has type mismatch issue) |
| apps/demos/Demos/TagBox/Overview/React/data.ts | Moves Product type to types.ts and adds proper annotations |
| apps/demos/Demos/TagBox/Overview/React/Tag.tsx | Adds comprehensive type annotations for props |
| apps/demos/Demos/TagBox/Overview/React/Item.tsx | Adds type annotations for component props |
| apps/demos/Demos/TagBox/Overview/React/App.tsx | Adds comprehensive types, improves state initialization and callback typing |
| apps/demos/Demos/TagBox/Grouping/ReactJs/data.js | Changes from default export to named export |
| apps/demos/Demos/TagBox/Grouping/ReactJs/App.js | Updates to use named import and removes unnecessary useState |
| apps/demos/Demos/TagBox/Grouping/React/types.ts | Adds Product type definition |
| apps/demos/Demos/TagBox/Grouping/React/data.ts | Adds Product type annotation to products array |
| apps/demos/Demos/TagBox/Grouping/React/Group.tsx | Adds GroupProps interface for type safety |
| apps/demos/Demos/TagBox/Grouping/React/App.tsx | Adds types, uses satisfies, and removes unnecessary useState |
| apps/demos/Demos/Switch/Overview/ReactJs/App.js | Improves callback to use destructuring pattern |
| apps/demos/Demos/Switch/Overview/React/App.tsx | Adds type annotations and improves callback destructuring |
da78946 to
3b1529a
Compare
…ements-in-demos-editors-part-3
No description provided.