Commit 0809a3b
authored
## Which problem is this PR solving?
- Resolves #3392
## Description of the changes
- Migrated the `Node` component from a class-based component to a
functional component with `React.memo()`
- Converted `Node` class component extending `React.PureComponent` to a
functional component
- Wrapped the component with `React.memo()` to preserve the shallow prop
comparison behavior of `PureComponent`
- Destructured props directly in the function signature
- Removed the `render()` method and converted to direct return statement
- Maintained generic type support using double type assertion pattern:
`as unknown as <T = {}>(props: TProps<T>) => React.ReactElement | null`
- Preserved all existing functionality including conditional rendering
logic
- No changes to component logic or behavior, only structural refactoring
## How was this change tested?
- All existing plexus tests pass (18 tests)
- TypeScript compilation successful
- Prettier formatting verified
- Build successful for plexus package
- Minimal diff: 18 insertions, 18 deletions
## Proof -
<img width="367" height="123" alt="3392 proof"
src="https://github.com/user-attachments/assets/85bdb61c-d456-4d66-a121-090e7ee4c11c"
/>
## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/main/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully: `make lint test`
## AI Usage in this PR (choose one)
See [AI Usage
Policy](https://github.com/jaegertracing/jaeger/blob/main/CONTRIBUTING_GUIDELINES.md#ai-usage-policy).
- [ ] **None**: No AI tools were used in creating this PR
- [ ] **Light**: AI provided minor assistance (formatting, simple
suggestions)
- [x] **Moderate**: AI helped with code generation or debugging specific
parts
- [ ] **Heavy**: AI generated most or all of the code changes
Signed-off-by: hharshhsaini <sainiharsh3311@gmail.com>
1 parent be1bcad commit 0809a3b
1 file changed
+18
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
47 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
48 | 46 | | |
| 47 | + | |
| 48 | + | |
0 commit comments