Add type check to core component since they will be used in JS

This commit is contained in:
Himanshu Mishra
2020-04-22 03:17:33 +09:00
parent d454803525
commit 219f058f02
@@ -16,6 +16,7 @@
import React, { FC, useRef, useState } from 'react';
import { IconButton, makeStyles, Tooltip } from '@material-ui/core';
import PropTypes from 'prop-types';
import CopyIcon from '@material-ui/icons/FileCopy';
import { BackstageTheme } from '@backstage/theme';
import { errorApiRef, useApi } from 'api';
@@ -103,4 +104,11 @@ const CopyTextButton: FC<Props> = props => {
);
};
// Type check for the JS files using this core component
CopyTextButton.propTypes = {
text: PropTypes.string.isRequired,
tooltipDelay: PropTypes.number,
tooltipText: PropTypes.string,
};
export default CopyTextButton;