korbit-ai[bot] commented on code in PR #34809:
URL: https://github.com/apache/superset/pull/34809#discussion_r2292783345
##########
superset-frontend/packages/superset-ui-core/src/components/Icons/AsyncIcon.tsx:
##########
@@ -46,6 +47,11 @@ const AsyncIcon = (props: IconType) => {
return (
<BaseIconComponent
component={ImportedSVG.current || TransparentIcon}
+ fileName={fileName}
+ customIcons={customIcons}
+ iconSize={iconSize}
+ iconColor={iconColor}
+ viewBox={viewBox}
{...restProps}
/>
Review Comment:
### Duplicate prop spreading <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
Props are being spread twice in the BaseIconComponent. The extracted props
(fileName, customIcons, etc.) are explicitly passed and then included again
through ...restProps.
###### Why this matters
This creates potential prop conflicts and makes the component's behavior
unpredictable as the same props could be passed with different values. It also
violates the Single Responsibility Principle by handling the same props in
multiple ways.
###### Suggested change ∙ *Feature Preview*
```typescript
return (
<BaseIconComponent
component={ImportedSVG.current || TransparentIcon}
{...props}
/>
);
```
Or if the props need transformation:
```typescript
const transformedProps = {
...props,
component: ImportedSVG.current || TransparentIcon,
};
return <BaseIconComponent {...transformedProps} />;
```
###### Provide feedback to improve future suggestions
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/95e19598-76ed-4ed5-aef4-f4f707e170e7/upvote)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/95e19598-76ed-4ed5-aef4-f4f707e170e7?what_not_true=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/95e19598-76ed-4ed5-aef4-f4f707e170e7?what_out_of_scope=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/95e19598-76ed-4ed5-aef4-f4f707e170e7?what_not_in_standard=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/95e19598-76ed-4ed5-aef4-f4f707e170e7)
</details>
<sub>
💬 Looking for more details? Reply to this comment to chat with Korbit.
</sub>
<!--- korbi internal id:f05744de-be48-467d-bee1-ac743b60bf5c -->
[](f05744de-be48-467d-bee1-ac743b60bf5c)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]