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


##########
superset-frontend/src/hooks/useUnsavedChangesPrompt/index.ts:
##########
@@ -69,15 +70,21 @@ export const useUnsavedChangesPrompt = ({
   }, [onSave]);
 
   const blockCallback = useCallback(
-    ({ pathname }: { pathname: string }) => {
+    ({
+      pathname,
+      state,
+    }: {
+      pathname: Location['state'];
+      state: Path['pathname'];

Review Comment:
   ### Swapped type annotations for pathname and state parameters 
<sub>![category 
Functionality](https://img.shields.io/badge/Functionality-0284c7)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The type annotations for pathname and state parameters are swapped - 
pathname should be Path['pathname'] (string) and state should be 
Location['state'] (any).
   
   
   ###### Why this matters
   This type mismatch will cause TypeScript compilation errors and runtime 
issues when the function receives a string pathname but expects 
Location['state'], and receives state data but expects Path['pathname'].
   
   ###### Suggested change ∙ *Feature Preview*
   Correct the type annotations:
   ```typescript
   ({
     pathname,
     state,
   }: {
     pathname: Path['pathname'];
     state: Location['state'];
   }) => {
   ```
   
   
   ###### 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/a8da02ab-0bce-4982-803d-2e0923bdfa2d/upvote)
 
[![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/a8da02ab-0bce-4982-803d-2e0923bdfa2d?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/a8da02ab-0bce-4982-803d-2e0923bdfa2d?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/a8da02ab-0bce-4982-803d-2e0923bdfa2d?what_not_in_standard=true)
 
[![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/a8da02ab-0bce-4982-803d-2e0923bdfa2d)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:ef487b31-9fd0-4ab0-8063-8cccc59ce7d2 -->
   
   
   [](ef487b31-9fd0-4ab0-8063-8cccc59ce7d2)



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