You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/08/31 22:06:36 UTC

[GitHub] graceguo-supercat commented on a change in pull request #5771: [dashboard] Add alert when user deleting root level tab

graceguo-supercat commented on a change in pull request #5771: [dashboard] Add alert when user deleting root level tab
URL: https://github.com/apache/incubator-superset/pull/5771#discussion_r214485687
 
 

 ##########
 File path: superset/assets/src/dashboard/components/IconButton.jsx
 ##########
 @@ -2,14 +2,15 @@ import React from 'react';
 import PropTypes from 'prop-types';
 
 const propTypes = {
-  onClick: PropTypes.func.isRequired,
+  onClick: PropTypes.func,
   className: PropTypes.string,
   label: PropTypes.string,
 };
 
 const defaultProps = {
   className: null,
   label: null,
+  onClick: () => true,
 
 Review comment:
   i want to re-use `IconButton` component, and it required a onClick callback. in my case, i want to use IconButton as trigger to show modal, and ModalTrigger will bind onClick itself. I can't pass in onClick callback for this instance.
   
   so here i changed onClick prop not required, and add a default callback. Not sure this is right way.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org