korbit-ai[bot] commented on code in PR #34757:
URL: https://github.com/apache/superset/pull/34757#discussion_r2285574655


##########
superset-frontend/src/components/Datasource/DatasourceModal.tsx:
##########
@@ -92,6 +99,8 @@ const DatasourceModal: 
FunctionComponent<DatasourceModalProps> = ({
 }) => {
   const theme = useTheme();
   const [currentDatasource, setCurrentDatasource] = useState(datasource);
+  const syncColumnsRef = useRef(false);
+  const [confirmModal, setConfirmModal] = useState<any>(null);

Review Comment:
   ### Unsafe use of 'any' type <sub>![category 
Design](https://img.shields.io/badge/Design-0d9488)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The code uses 'any' type for the confirmModal state, bypassing TypeScript's 
type checking benefits.
   
   
   ###### Why this matters
   Using 'any' defeats the purpose of TypeScript's type system and can lead to 
runtime errors that could have been caught during compilation.
   
   ###### Suggested change ∙ *Feature Preview*
   Define proper types for the modal:
   ```typescript
   import { ModalFuncInstance } from 'antd/lib/modal/confirm';
   
   const [confirmModal, setConfirmModal] = useState<ModalFuncInstance | 
null>(null);
   ```
   
   
   ###### Provide feedback to improve future suggestions
   [![Nice 
Catch](https://img.shields.io/badge/👍%20Nice%20Catch-71BC78)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/67373942-0ac9-4776-8987-f66977c6bdfe/upvote)
 
[![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/67373942-0ac9-4776-8987-f66977c6bdfe?what_not_true=true)
  [![Not in 
Scope](https://img.shields.io/badge/👎%20Out%20of%20PR%20scope-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/67373942-0ac9-4776-8987-f66977c6bdfe?what_out_of_scope=true)
 [![Not in coding 
standard](https://img.shields.io/badge/👎%20Not%20in%20our%20standards-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/67373942-0ac9-4776-8987-f66977c6bdfe?what_not_in_standard=true)
 
[![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/67373942-0ac9-4776-8987-f66977c6bdfe)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:ba9b4c62-9576-47ef-b279-1970aa0bf156 -->
   
   
   [](ba9b4c62-9576-47ef-b279-1970aa0bf156)



-- 
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]

Reply via email to