riahk commented on a change in pull request #10880:
URL:
https://github.com/apache/incubator-superset/pull/10880#discussion_r488954474
##########
File path: superset-frontend/src/components/Menu/SubMenu.tsx
##########
@@ -66,6 +81,10 @@ export interface SubMenuProps {
name: string;
children?: MenuChild[];
activeChild?: MenuChild['name'];
+ /* If usesRouter is true, a react-router <Link> component will be used
instead of href.
+ * ONLY set usesRouter to true if SubMenu is wrapped in a react-router
<Router>;
+ * otherwise, a 'You should not use <Link> outside a <Router>' error will
be thrown */
+ usesRouter?: boolean;
Review comment:
Did some digging, looks like `useHistory` is just another way to access
the router's history object, so I've updated the `SubMenu` to check for that!
This will allow implicit Router checking.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]