Adjust the typing and the prop-type definitions related to the ButtonComponent property

This commit is contained in:
Iliyan Yotov 2020-05-08 00:32:48 +03:00
parent 4a37243ec2
commit c1659cef53
2 changed files with 2 additions and 2 deletions

2
src/index.d.ts vendored
View File

@ -32,7 +32,7 @@ export interface CookieConsentProps {
disableButtonStyles?: boolean;
enableDeclineButton?: boolean;
flipButtons?: boolean;
ButtonComponent?: Function | React.ReactElement;
ButtonComponent?: React.ElementType;
}
export default class CookieConsent extends React.Component<CookieConsentProps, {}> {}

View File

@ -301,7 +301,7 @@ CookieConsent.propTypes = {
disableButtonStyles: PropTypes.bool,
enableDeclineButton: PropTypes.bool,
flipButtons: PropTypes.bool,
ButtonComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.element])
ButtonComponent: PropTypes.elementType
};
CookieConsent.defaultProps = {