Skip to content

Commit

Permalink
fix: warnings and mistakes in propTypes (#2911)
Browse files Browse the repository at this point in the history
  • Loading branch information
JackUait committed Jul 11, 2022
1 parent a244b39 commit 74b1071
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
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

0 comments on commit 74b1071

Please sign in to comment.