Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mistakes in propTypes #2911

Merged
merged 10 commits into from Jul 11, 2022
2 changes: 1 addition & 1 deletion packages/react-ui/components/Link/Link.tsx
Expand Up @@ -77,7 +77,7 @@ export class Link extends React.Component<LinkProps, LinkState> {

href: PropTypes.string,

icon: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
icon: PropTypes.node,

use: PropTypes.oneOf(['default', 'success', 'danger', 'grayed']),
};
Expand Down
2 changes: 1 addition & 1 deletion packages/react-ui/components/MenuItem/MenuItem.tsx
Expand Up @@ -99,7 +99,7 @@ export class MenuItem extends React.Component<MenuItemProps> {

href: PropTypes.string,

icon: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
icon: PropTypes.node,

loose: PropTypes.bool,

Expand Down
7 changes: 4 additions & 3 deletions packages/react-ui/components/Textarea/TextareaCounter.tsx
@@ -1,6 +1,7 @@
import React, { SyntheticEvent, useContext, useCallback, useImperativeHandle, useState } from 'react';
import propTypes from 'prop-types';

import { safePropTypesInstanceOf } from '../../lib/SSRSafe';
import { forwardRefAndName } from '../../lib/forwardRefAndName';
import { HelpDotIcon } from '../../internal/icons/16px';
import { ThemeContext } from '../../lib/theming/ThemeContext';
Expand Down Expand Up @@ -65,8 +66,8 @@ export const TextareaCounter = forwardRefAndName<TextareaCounterRef, TextareaCou

TextareaCounter.propTypes = {
length: propTypes.number.isRequired,
value: propTypes.oneOf([propTypes.string, propTypes.number]),
help: propTypes.oneOf([propTypes.node, propTypes.func]),
value: propTypes.oneOfType([propTypes.string, propTypes.number]),
help: propTypes.oneOfType([propTypes.node, propTypes.func]),
onCloseHelp: propTypes.func.isRequired,
textarea: propTypes.node.isRequired,
textarea: safePropTypesInstanceOf(() => HTMLElement).isRequired,
};
2 changes: 1 addition & 1 deletion packages/react-ui/internal/icons/16px/index.tsx
Expand Up @@ -30,7 +30,7 @@ const SvgIcon = forwardRefAndName<HTMLElement, SvgIconProps>(

SvgIcon.propTypes = {
color: propTypes.string,
size: propTypes.oneOf([propTypes.string, propTypes.number]),
size: propTypes.oneOfType([propTypes.string, propTypes.number]),
style: propTypes.object,
children: propTypes.node,
};
Expand Down