Damans227 commented on a change in pull request #17603:
URL: https://github.com/apache/superset/pull/17603#discussion_r759832861



##########
File path: 
superset-frontend/src/SqlLab/components/EstimateQueryCostButton/index.tsx
##########
@@ -93,7 +91,7 @@ const EstimateQueryCostButton = props => {
         triggerNode={
           <Button
             style={{ height: 32, padding: '4px 15px' }}
-            onClick={onClick}
+            onClick={getEstimate()}

Review comment:
       @etr2460 Looks like this is going to fail. I checked the type 
declaration for `onClick` prop locally in my text editor (i.e. VS Code) and it 
seems like `onClick` expects a method that is similar to an event handler.
   
   Here is the error I get after changing the prop to `onClick={getEstimate}`: 
   
   ```
   Type 'Function' is not assignable to type 'OnClickHandler'.
     Type 'Function' provides no match for the signature '(event: 
MouseEvent<HTMLElement, MouseEvent>): void'.ts(2322)
   index.tsx(47, 3): The expected type comes from property 'onClick' which is 
declared here on type 'IntrinsicAttributes & ButtonProps'
   (JSX attribute) ButtonProps.onClick?: OnClickHandler | undefined
   
   ```
   
   So, I guess we should restore that other `onClick` method which we removed 
earlier thinking that it was just there to call the `getEstimate` method, and 
then may be rename it to `onClickHandler` to avoid such confusion in future. 




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