You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DataGrid/TreeList: migrate React class snippets to functions - #9193
Converts React class examples in the DataGrid and TreeList API reference and guides to TypeScript function components with hooks.
To review faster:
- Start with examples that use state, refs, async requests, or column callbacks. These contain the meaningful behavior changes.
- Other examples follow the same pattern: `App.tsx`, typed handlers, and removal of constructors, bindings, and `render()`.
- Check the accompanying fixes: email-response parsing, export cleanup, invalid JSX, and repeated selection updates.
Only React snippets changed.
This React example creates the ref with createRef inside App, so a rerender replaces the ref object; it also uses Dx{WidgetName}Component, which is the Angular wrapper type and is not imported here. After placeholder substitution, the sample does not type-check and can lose the component instance on rerender. Use useRef<{WidgetName}Ref>(null) and pass that ref directly to the component instead.
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🔵 Needs a closer look
Four moderate issues and two minor cleanup issues remain unresolved.
Review effort: Lite Findings: None
Previously missed (1)
In code that hasn't changed since last review
Indent the if statement inside the callback
concepts/05 UI Components/DataGrid/99 How To/Customize Header Filter Data Source/30 Change the Generated Data Source.md:150
This if statement is flush with the document margin instead of being nested in the callback, unlike the surrounding TypeScript sample. Although whitespace does not change execution, it makes the migrated example appear malformed and inconsistent with the rest of the code block; indent it to the callback body.
The reason will be displayed to describe this comment to others. Learn more.
I noticed that our code style is inconsistent in some places. For example, there are blank lines between imports and after the import statements in some files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Converts React class examples in the DataGrid and TreeList API reference and guides to TypeScript function components with hooks.
To review faster:
App.tsx, typed handlers, and removal of constructors, bindings, andrender().Only React snippets changed.