Merge pull request #66 from iliyanyotov/typings-styled-components

Changed ButtonComponent proptype definitions to ElementType. See https://reactjs.org/docs/typechecking-with-proptypes.html for details.
This commit is contained in:
2020-05-10 10:59:30 +02:00
committed by GitHub
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; disableButtonStyles?: boolean;
enableDeclineButton?: boolean; enableDeclineButton?: boolean;
flipButtons?: boolean; flipButtons?: boolean;
ButtonComponent?: Function | React.ReactElement; ButtonComponent?: React.ElementType;
} }
export default class CookieConsent extends React.Component<CookieConsentProps, {}> {} export default class CookieConsent extends React.Component<CookieConsentProps, {}> {}

View File

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