Antonio-RiveroMartnez commented on code in PR #21065:
URL: https://github.com/apache/superset/pull/21065#discussion_r968545276


##########
superset-frontend/src/views/components/RightMenu.tsx:
##########
@@ -118,8 +118,8 @@ const RightMenu = ({
     ALLOWED_EXTENSIONS,
     HAS_GSHEETS_INSTALLED,
   } = useSelector<any, ExtentionConfigs>(state => state.common.conf);
-  const [showModal, setShowModal] = useState<boolean>(false);
-  const [engine, setEngine] = useState<string>('');
+  const [showModal, setShowModal] = React.useState<boolean>(false);

Review Comment:
   You cannot because if you do something like:
   ```
   jest.mock('react', () => ({
     ...jest.requireActual('react'),
     useState: jest.fn(),
   }));
   ```
   the whole tests are going to fail because `React` itself wont have all what 
it needs to render and handle cases where we actually need regular useState, 
and after a while researching I found that spying on native hooks from react 
would require such usage as we have here. I guess it's the same reason why this 
other component uses it already in our code base:
   
   
https://github.com/apache/superset/tree/master/superset-frontend/src/explore/components/controls/ControlPopover



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