Skip to content

Commit

Permalink
chore(deps): update dependency @types/prop-types to v15.7.6 (#14702)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency @types/prop-types to v15.7.6

* chore(@types): update both packages

* fix(React): fix ts errors

* chore(yarn): run dedupe

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: TJ Egan <tw15egan@gmail.com>
  • Loading branch information
renovate[bot] and tw15egan committed Jan 22, 2024
1 parent d82da66 commit a3e4112
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 25 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -29,8 +29,8 @@
"postinstall": "husky install"
},
"resolutions": {
"@types/react": "~17.0.2",
"@types/prop-types": "15.7.5",
"@types/react": "~18.2.33",
"@types/prop-types": "15.7.9",
"ast-types": "^0.14.0",
"node-sass": "^9.0.0",
"react": "~18.2.0",
Expand Down
Expand Up @@ -207,10 +207,7 @@ export default class ContentSwitcher extends React.Component<
} = this.props;

const isIconOnly = React.Children?.map(children, (child) => {
return (
(child as { type: { displayName: string } }).type.displayName ===
'IconSwitch'
);
return (child as JSX.Element).type.displayName === 'IconSwitch';
})?.every((val) => val === true);

const classes = classNames(`${prefix}--content-switcher`, className, {
Expand Down
Expand Up @@ -31,7 +31,7 @@ export interface TableToolbarMenuProps
/**
* Optional prop to allow overriding the default menu icon
*/
renderIcon?: React.ReactNode;
renderIcon?: any;
}

const TableToolbarMenu: React.FC<TableToolbarMenuProps> = ({
Expand Down
8 changes: 3 additions & 5 deletions packages/react/src/components/DatePicker/DatePicker.tsx
Expand Up @@ -28,7 +28,6 @@ import { usePrefix } from '../../internal/usePrefix';
import { useSavedCallback } from '../../internal/useSavedCallback';
import { FormContext } from '../FluidForm';
import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
import { ReactAttr } from '../../types/common';

// Weekdays shorthand for english locale
l10n.en.weekdays.shorthand.forEach((_day, index) => {
Expand Down Expand Up @@ -186,7 +185,7 @@ function updateClassNames(calendar, prefix) {
});
}
}
type ExcludedAttributes = 'value' | 'onChange' | 'locale';

export type DatePickerTypes = 'simple' | 'single' | 'range';
export type CalRef = {
inline: boolean;
Expand All @@ -200,8 +199,7 @@ export type CalRef = {
plugins: [];
clickOpens: any;
};
interface DatePickerProps
extends Omit<ReactAttr<HTMLDivElement>, ExcludedAttributes> {
interface DatePickerProps {
/**
* Flatpickr prop passthrough enables direct date input, and when set to false,
* we must clear dates manually by resetting the value prop to empty string making it a controlled input.
Expand Down Expand Up @@ -483,7 +481,7 @@ const DatePicker = React.forwardRef(function DatePicker(
[String(className)]: className,
});

const childrenWithProps = React.Children.toArray(children).map(
const childrenWithProps = React.Children.toArray(children as any).map(
(child: any, index) => {
if (
index === 0 &&
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Dropdown/Dropdown.tsx
Expand Up @@ -506,7 +506,7 @@ const Dropdown = React.forwardRef(
? renderSelectedItem
? renderSelectedItem(selectedItem)
: itemToString(selectedItem)
: label}
: (label as any)}
</span>
<ListBox.MenuIcon
isOpen={isOpen}
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/ListBox/ListBoxMenu.tsx
Expand Up @@ -15,6 +15,8 @@ type ExcludedAttributes = 'id';

export interface ListBoxMenuProps
extends Omit<ReactAttr<HTMLUListElement>, ExcludedAttributes> {
children?: any;

/**
* Specify a custom `id`
*/
Expand Down
13 changes: 10 additions & 3 deletions packages/react/src/components/Stack/index.tsx
Expand Up @@ -5,14 +5,21 @@
* LICENSE file in the root directory of this source tree.
*/

import React from 'react';
import React, { ReactNode } from 'react';
import { Stack } from './Stack';
import { ForwardRefReturn } from '../../types/common';

const HStack = React.forwardRef(function HStack(props, ref) {
const HStack: ForwardRefReturn<ReactNode> = React.forwardRef(function HStack(
props,
ref
) {
return <Stack {...props} ref={ref} orientation="horizontal" />;
});

const VStack = React.forwardRef(function VStack(props, ref) {
const VStack: ForwardRefReturn<ReactNode> = React.forwardRef(function VStack(
props,
ref
) {
return <Stack {...props} ref={ref} orientation="vertical" />;
});

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/TextInput/PasswordInput.tsx
Expand Up @@ -348,7 +348,7 @@ const PasswordInput = React.forwardRef(function PasswordInput(
setInputType(type);
}, [type]);

const Icon = normalizedProps.icon as typeof React.Component;
const Icon = normalizedProps.icon as any;

return (
<div className={inputWrapperClasses}>
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Expand Up @@ -7396,10 +7396,10 @@ __metadata:
languageName: node
linkType: hard

"@types/prop-types@npm:15.7.5":
version: 15.7.5
resolution: "@types/prop-types@npm:15.7.5"
checksum: 5b43b8b15415e1f298243165f1d44390403bb2bd42e662bca3b5b5633fdd39c938e91b7fce3a9483699db0f7a715d08cef220c121f723a634972fdf596aec980
"@types/prop-types@npm:15.7.9":
version: 15.7.9
resolution: "@types/prop-types@npm:15.7.9"
checksum: c7591d3ff7593e243908a07e1d3e2bb6e8879008af5800d8378115a90d0fdf669a1cae72a6d7f69e59c4fa7bb4c8ed61f6ebc1c520fe110c6f2b03ac02414072
languageName: node
linkType: hard

Expand Down Expand Up @@ -7442,14 +7442,14 @@ __metadata:
languageName: node
linkType: hard

"@types/react@npm:~17.0.2":
version: 17.0.50
resolution: "@types/react@npm:17.0.50"
"@types/react@npm:~18.2.33":
version: 18.2.33
resolution: "@types/react@npm:18.2.33"
dependencies:
"@types/prop-types": "npm:*"
"@types/scheduler": "npm:*"
csstype: "npm:^3.0.2"
checksum: 0b5482f7b0a97f49995fdcc8ee0f606eebf0035d1a7d2a1c65aa2dea06f668bd47bf74b23ce7416c1c74f93a814de5f3fab77988c314536c31c83cbb081acedd
checksum: 7f84dcf70eed3644973c7a47a63669d9e9ecc8d15b331fb272940a5c7cc322df11995eeeae1edfab5c278083cc3527477aa682c79f26667cfe8cd74481621884
languageName: node
linkType: hard

Expand Down

0 comments on commit a3e4112

Please sign in to comment.