jayeshchoudhary commented on code in PR #14736:
URL: https://github.com/apache/pinot/pull/14736#discussion_r1901863652


##########
pinot-controller/src/main/resources/app/pages/TenantDetails.tsx:
##########
@@ -152,6 +152,18 @@ const TenantPageDetails = ({ match }: 
RouteComponentProps<Props>) => {
   const [showRebalanceServerModal, setShowRebalanceServerModal] = 
useState(false);
   const [schemaJSONFormat, setSchemaJSONFormat] = useState(false);
 
+  // This is quite hacky, but it's the only way to get this to work with the 
dialog.
+  // The useState variables are simply for the dialog box to know what to 
render in
+  // the checkbox fields. The actual state of the checkboxes is stored in the 
refs.
+  // The refs are then used to determine how we delete the table. If you try 
to use
+  // the state variables in this class, you will not be able to get their 
latest values.
+  const [dialogCheckboxes, setDialogCheckboxes] = useState({
+    deleteImmediately: false,
+    deleteSchema: false
+  });
+  const deleteImmediatelyRef = useRef(false);
+  const deleteSchemaRef = useRef(false);
+

Review Comment:
   if the state can be used to render checkbox value then it can be used at 
other places as well. 
   do you know the reason of this behaviour? Iet me know if you want me to 
debug. I think its some react rendering issue.



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to