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: make typings compatible with @types/react@18 #4356

Merged
merged 2 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"@percy/cli": "^1.0.0-beta.73",
"@percy/cypress": "^3.1.1",
"@size-limit/file": "^4.5.5",
"@types/react": "^16.9.43",
"@types/react": "18.0.5",
"@typescript-eslint/eslint-plugin": "^3.7.1",
"@typescript-eslint/parser": "^3.7.1",
"@wojtekmaj/enzyme-adapter-react-17": "^0.1.1",
Expand Down
2 changes: 1 addition & 1 deletion src/addons/Radio/Radio.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export interface StrictRadioProps extends StrictCheckboxProps {
type?: 'checkbox' | 'radio'
}

declare const Radio: React.StatelessComponent<RadioProps>
declare const Radio: React.FC<RadioProps>

export default Radio
2 changes: 1 addition & 1 deletion src/addons/Select/Select.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface StrictSelectProps extends StrictDropdownProps {
options: DropdownItemProps[]
}

interface SelectComponent extends React.StatelessComponent<SelectProps> {
interface SelectComponent extends React.FC<SelectProps> {
Divider: typeof DropdownDivider
Header: typeof DropdownHeader
Item: typeof DropdownItem
Expand Down
2 changes: 1 addition & 1 deletion src/collections/Breadcrumb/BreadcrumbDivider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ export interface StrictBreadcrumbDividerProps {
icon?: SemanticShorthandItem<IconProps>
}

declare const BreadcrumbDivider: React.StatelessComponent<BreadcrumbDividerProps>
declare const BreadcrumbDivider: React.FC<BreadcrumbDividerProps>

export default BreadcrumbDivider
2 changes: 1 addition & 1 deletion src/collections/Form/Form.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface StrictFormProps {
widths?: 'equal'
}

export interface FormComponent extends React.StatelessComponent<FormProps> {
export interface FormComponent extends React.FC<FormProps> {
Field: typeof FormField
Button: typeof FormButton
Checkbox: typeof FormCheckbox
Expand Down
4 changes: 2 additions & 2 deletions src/collections/Form/FormButton.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface FormButtonProps extends StrictFormButtonProps {
}

export interface StrictFormButtonProps
extends StrictFormFieldProps,
extends Omit<StrictFormFieldProps, 'label'>,
Omit<StrictButtonProps, 'type'> {
/** An element type to render as (string or function). */
as?: any
Expand All @@ -22,6 +22,6 @@ export interface StrictFormButtonProps
label?: SemanticShorthandItem<LabelProps>
}

declare const FormButton: React.StatelessComponent<FormButtonProps>
declare const FormButton: React.FC<FormButtonProps>

export default FormButton
2 changes: 1 addition & 1 deletion src/collections/Form/FormCheckbox.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ export interface StrictFormCheckboxProps extends StrictFormFieldProps, StrictChe
type?: 'checkbox' | 'radio'
}

declare const FormCheckbox: React.StatelessComponent<FormCheckboxProps>
declare const FormCheckbox: React.FC<FormCheckboxProps>

export default FormCheckbox
2 changes: 1 addition & 1 deletion src/collections/Form/FormDropdown.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ export interface StrictFormDropdownProps extends StrictFormFieldProps, StrictDro
error?: any
}

declare const FormDropdown: React.StatelessComponent<FormDropdownProps>
declare const FormDropdown: React.FC<FormDropdownProps>

export default FormDropdown
2 changes: 1 addition & 1 deletion src/collections/Form/FormField.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ export interface StrictFormFieldProps {
width?: SemanticWIDTHS
}

declare const FormField: React.StatelessComponent<FormFieldProps>
declare const FormField: React.FC<FormFieldProps>

export default FormField
2 changes: 1 addition & 1 deletion src/collections/Form/FormGroup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ export interface StrictFormGroupProps {
widths?: SemanticWIDTHS | 'equal'
}

declare const FormGroup: React.StatelessComponent<FormGroupProps>
declare const FormGroup: React.FC<FormGroupProps>

export default FormGroup
6 changes: 4 additions & 2 deletions src/collections/Form/FormInput.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export interface FormInputProps extends StrictFormInputProps {
[key: string]: any
}

export interface StrictFormInputProps extends StrictFormFieldProps, StrictInputProps {
export interface StrictFormInputProps
extends Omit<StrictFormFieldProps, 'label'>,
StrictInputProps {
/** An element type to render as (string or function). */
as?: any

Expand All @@ -23,6 +25,6 @@ export interface StrictFormInputProps extends StrictFormFieldProps, StrictInputP
label?: SemanticShorthandItem<LabelProps>
}

declare const FormInput: React.StatelessComponent<FormInputProps>
declare const FormInput: React.FC<FormInputProps>

export default FormInput
2 changes: 1 addition & 1 deletion src/collections/Form/FormRadio.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ export interface StrictFormRadioProps extends StrictFormFieldProps, StrictRadioP
type?: 'checkbox' | 'radio'
}

declare const FormRadio: React.StatelessComponent<FormRadioProps>
declare const FormRadio: React.FC<FormRadioProps>

export default FormRadio
2 changes: 1 addition & 1 deletion src/collections/Form/FormSelect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ export interface StrictFormSelectProps extends StrictFormFieldProps, StrictSelec
options: DropdownItemProps[]
}

declare const FormSelect: React.StatelessComponent<FormSelectProps>
declare const FormSelect: React.FC<FormSelectProps>

export default FormSelect
2 changes: 1 addition & 1 deletion src/collections/Form/FormTextArea.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export interface StrictFormTextAreaProps extends StrictFormFieldProps, StrictTex
control?: any
}

declare const FormTextArea: React.StatelessComponent<FormTextAreaProps>
declare const FormTextArea: React.FC<FormTextAreaProps>

export default FormTextArea
2 changes: 1 addition & 1 deletion src/collections/Grid/Grid.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export interface StrictGridProps {
verticalAlign?: SemanticVERTICALALIGNMENTS
}

interface GridComponent extends React.StatelessComponent<GridProps> {
interface GridComponent extends React.FC<GridProps> {
Column: typeof GridColumn
Row: typeof GridRow
}
Expand Down
2 changes: 1 addition & 1 deletion src/collections/Grid/GridColumn.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ export interface StrictGridColumnProps {
width?: SemanticWIDTHS
}

declare const GridColumn: React.StatelessComponent<GridColumnProps>
declare const GridColumn: React.FC<GridColumnProps>

export default GridColumn
2 changes: 1 addition & 1 deletion src/collections/Grid/GridRow.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ export interface StrictGridRowProps {
verticalAlign?: SemanticVERTICALALIGNMENTS
}

declare const GridRow: React.StatelessComponent<GridRowProps>
declare const GridRow: React.FC<GridRowProps>

export default GridRow
2 changes: 1 addition & 1 deletion src/collections/Menu/MenuMenu.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export interface StrictMenuMenuProps {
position?: 'left' | 'right'
}

declare const MenuMenu: React.StatelessComponent<MenuMenuProps>
declare const MenuMenu: React.FC<MenuMenuProps>

export default MenuMenu
2 changes: 1 addition & 1 deletion src/collections/Message/MessageContent.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ export interface StrictMessageContentProps {
content?: SemanticShorthandContent
}

declare const MessageContent: React.StatelessComponent<MessageContentProps>
declare const MessageContent: React.FC<MessageContentProps>

export default MessageContent
2 changes: 1 addition & 1 deletion src/collections/Message/MessageHeader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ export interface StrictMessageHeaderProps {
content?: SemanticShorthandContent
}

declare const MessageHeader: React.StatelessComponent<MessageHeaderProps>
declare const MessageHeader: React.FC<MessageHeaderProps>

export default MessageHeader
2 changes: 1 addition & 1 deletion src/collections/Message/MessageItem.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ export interface StrictMessageItemProps {
content?: SemanticShorthandContent
}

declare const MessageItem: React.StatelessComponent<MessageItemProps>
declare const MessageItem: React.FC<MessageItemProps>

export default MessageItem
2 changes: 1 addition & 1 deletion src/collections/Message/MessageList.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ export interface StrictMessageListProps {
items?: SemanticShorthandCollection<MessageItemProps>
}

declare const MessageList: React.StatelessComponent<MessageListProps>
declare const MessageList: React.FC<MessageListProps>

export default MessageList
2 changes: 1 addition & 1 deletion src/collections/Table/Table.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export interface StrictTableProps {
verticalAlign?: SemanticVERTICALALIGNMENTS
}

interface TableComponent extends React.StatelessComponent<TableProps> {
interface TableComponent extends React.FC<TableProps> {
Body: typeof TableBody
Cell: typeof TableCell
Footer: typeof TableFooter
Expand Down
2 changes: 1 addition & 1 deletion src/collections/Table/TableBody.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export interface StrictTableBodyProps {
className?: string
}

declare const TableBody: React.StatelessComponent<TableBodyProps>
declare const TableBody: React.FC<TableBodyProps>

export default TableBody
2 changes: 1 addition & 1 deletion src/collections/Table/TableCell.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ export interface StrictTableCellProps {
width?: SemanticWIDTHS
}

declare const TableCell: React.StatelessComponent<TableCellProps>
declare const TableCell: React.FC<TableCellProps>

export default TableCell
2 changes: 1 addition & 1 deletion src/collections/Table/TableFooter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export interface StrictTableFooterProps extends StrictTableHeaderProps {
as?: any
}

declare const TableFooter: React.StatelessComponent<TableFooterProps>
declare const TableFooter: React.FC<TableFooterProps>

export default TableFooter
2 changes: 1 addition & 1 deletion src/collections/Table/TableHeader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export interface StrictTableHeaderProps {
fullWidth?: boolean
}

declare const TableHeader: React.StatelessComponent<TableHeaderProps>
declare const TableHeader: React.FC<TableHeaderProps>

export default TableHeader
2 changes: 1 addition & 1 deletion src/collections/Table/TableHeaderCell.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export interface StrictTableHeaderCellProps extends StrictTableCellProps {
sorted?: 'ascending' | 'descending'
}

declare const TableHeaderCell: React.StatelessComponent<TableHeaderCellProps>
declare const TableHeaderCell: React.FC<TableHeaderCellProps>

export default TableHeaderCell
2 changes: 1 addition & 1 deletion src/collections/Table/TableRow.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ export interface StrictTableRowProps {
warning?: boolean
}

declare const TableRow: React.StatelessComponent<TableRowProps>
declare const TableRow: React.FC<TableRowProps>

export default TableRow
2 changes: 1 addition & 1 deletion src/elements/Button/ButtonContent.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ export interface StrictButtonContentProps {
visible?: boolean
}

declare const ButtonContent: React.StatelessComponent<ButtonContentProps>
declare const ButtonContent: React.FC<ButtonContentProps>

export default ButtonContent
2 changes: 1 addition & 1 deletion src/elements/Button/ButtonGroup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ export interface StrictButtonGroupProps {
widths?: SemanticWIDTHS
}

declare const ButtonGroup: React.StatelessComponent<ButtonGroupProps>
declare const ButtonGroup: React.FC<ButtonGroupProps>

export default ButtonGroup
2 changes: 1 addition & 1 deletion src/elements/Button/ButtonOr.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export interface StrictButtonOrProps {
text?: number | string
}

declare const ButtonOr: React.StatelessComponent<ButtonOrProps>
declare const ButtonOr: React.FC<ButtonOrProps>

export default ButtonOr
2 changes: 1 addition & 1 deletion src/elements/Container/Container.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ export interface StrictContainerProps {
textAlign?: SemanticTEXTALIGNMENTS
}

declare const Container: React.StatelessComponent<ContainerProps>
declare const Container: React.FC<ContainerProps>

export default Container
2 changes: 1 addition & 1 deletion src/elements/Divider/Divider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ export interface StrictDividerProps {
vertical?: boolean
}

declare const Divider: React.StatelessComponent<DividerProps>
declare const Divider: React.FC<DividerProps>

export default Divider
2 changes: 1 addition & 1 deletion src/elements/Header/Header.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export interface StrictHeaderProps {
textAlign?: SemanticTEXTALIGNMENTS
}

interface HeaderComponent extends React.StatelessComponent<HeaderProps> {
interface HeaderComponent extends React.FC<HeaderProps> {
Content: typeof HeaderContent
Subheader: typeof HeaderSubHeader
}
Expand Down
2 changes: 1 addition & 1 deletion src/elements/Header/HeaderContent.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ export interface StrictHeaderContentProps {
content?: SemanticShorthandContent
}

declare const HeaderContent: React.StatelessComponent<HeaderContentProps>
declare const HeaderContent: React.FC<HeaderContentProps>

export default HeaderContent
2 changes: 1 addition & 1 deletion src/elements/Header/HeaderSubheader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ export interface StrictHeaderSubheaderProps {
content?: SemanticShorthandContent
}

declare const HeaderSubHeader: React.StatelessComponent<HeaderSubheaderProps>
declare const HeaderSubHeader: React.FC<HeaderSubheaderProps>

export default HeaderSubHeader
2 changes: 1 addition & 1 deletion src/elements/Icon/IconGroup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ export interface StrictIconGroupProps {
size?: IconSizeProp
}

declare const IconGroup: React.StatelessComponent<IconGroupProps>
declare const IconGroup: React.FC<IconGroupProps>

export default IconGroup
2 changes: 1 addition & 1 deletion src/elements/Image/Image.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export interface StrictImageProps {
wrapped?: boolean
}

interface ImageComponent extends React.StatelessComponent<ImageProps> {
interface ImageComponent extends React.FC<ImageProps> {
Group: typeof ImageGroup
}

Expand Down
2 changes: 1 addition & 1 deletion src/elements/Image/ImageGroup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export interface StrictImageGroupProps {
size?: SemanticSIZES
}

declare const ImageGroup: React.StatelessComponent<ImageGroupProps>
declare const ImageGroup: React.FC<ImageGroupProps>

export default ImageGroup
2 changes: 1 addition & 1 deletion src/elements/Label/LabelDetail.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ export interface StrictLabelDetailProps {
content?: SemanticShorthandContent
}

declare const LabelDetail: React.StatelessComponent<LabelDetailProps>
declare const LabelDetail: React.FC<LabelDetailProps>

export default LabelDetail
2 changes: 1 addition & 1 deletion src/elements/Label/LabelGroup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ export interface StrictLabelGroupProps {
tag?: boolean
}

declare const LabelGroup: React.StatelessComponent<LabelGroupProps>
declare const LabelGroup: React.FC<LabelGroupProps>

export default LabelGroup
2 changes: 1 addition & 1 deletion src/elements/List/List.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export interface StrictListProps {
verticalAlign?: SemanticVERTICALALIGNMENTS
}

interface ListComponent extends React.StatelessComponent<ListProps> {
interface ListComponent extends React.FC<ListProps> {
Content: typeof ListContent
Description: typeof ListDescription
Header: typeof ListHeader
Expand Down
2 changes: 1 addition & 1 deletion src/elements/List/ListContent.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ export interface StrictListContentProps {
verticalAlign?: SemanticVERTICALALIGNMENTS
}

declare const ListContent: React.StatelessComponent<ListContentProps>
declare const ListContent: React.FC<ListContentProps>

export default ListContent
2 changes: 1 addition & 1 deletion src/elements/List/ListDescription.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ export interface StrictListDescriptionProps {
content?: SemanticShorthandContent
}

declare const ListDescription: React.StatelessComponent<ListDescriptionProps>
declare const ListDescription: React.FC<ListDescriptionProps>

export default ListDescription
2 changes: 1 addition & 1 deletion src/elements/List/ListHeader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ export interface StrictListHeaderProps {
content?: SemanticShorthandContent
}

declare const ListHeader: React.StatelessComponent<ListHeaderProps>
declare const ListHeader: React.FC<ListHeaderProps>

export default ListHeader
Loading