ktmud commented on a change in pull request #11421:
URL:
https://github.com/apache/incubator-superset/pull/11421#discussion_r511655981
##########
File path: superset-frontend/src/components/Button/index.tsx
##########
@@ -233,22 +233,23 @@ const SupersetButton = styled(BootstrapButton)`
}
`;
-export default function Button(props: ButtonProps) {
- const buttonProps = {
- ...props,
- bsSize: props.buttonSize,
- disabled: props.disabled || false,
- placement: props.placement || 'top',
- };
- const { tooltip, placement, dropdownItems } = props;
- delete buttonProps.tooltip;
- delete buttonProps.placement;
Review comment:
TypeScript will now complain:
https://devblogs.microsoft.com/typescript/announcing-typescript-4-0-beta/#operands-for-delete-must-be-optional
I refactored the whole button component with prop deconstruction to
eliminate the need to use `delete` prop.
----------------------------------------------------------------
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]