Skip to content

Commit

Permalink
replace JSX.Element to React.ReactElement
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiPirovich committed Oct 31, 2022
1 parent 0179c01 commit 11fde70
Show file tree
Hide file tree
Showing 26 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/components/ui/autocomplete/autocomplete.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ describe('@autocomplete: component checks', () => {
props.onChangeText?.(query);
};

const renderOption = (item, index): JSX.Element => (
const renderOption = (item, index): React.ReactElement => (
<AutocompleteItem
key={index}
title={item.title}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/avatar/avatar.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {

describe('@avatar: component checks', () => {

const TestAvatar = (props: Partial<AvatarProps>): JSX.Element => (
const TestAvatar = (props: Partial<AvatarProps>): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down
6 changes: 3 additions & 3 deletions src/components/ui/bottomNavigation/bottomNavigation.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { TabIndicator } from '../shared/tabIndicator.component';

describe('@bottom-navigation-tab: component checks', () => {

const TestBottomNavigationTab = (props?: BottomNavigationTabProps): JSX.Element => (
const TestBottomNavigationTab = (props?: BottomNavigationTabProps): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand All @@ -43,7 +43,7 @@ describe('@bottom-navigation-tab: component checks', () => {
);

it('should render component passed to icon prop', () => {
const Icon = (props?: Partial<ImageProps>): JSX.Element => (
const Icon = (props?: Partial<ImageProps>): React.ReactElement => (
<Image
{...props}
source={{ uri: 'https://akveo.github.io/eva-icons/fill/png/128/star.png' }}
Expand Down Expand Up @@ -132,7 +132,7 @@ describe('@bottom-navigation-tab: component checks', () => {

describe('@bottom-navigation: component checks', () => {

const TestBottomNavigation = (props?: Partial<BottomNavigationProps>): JSX.Element => {
const TestBottomNavigation = (props?: Partial<BottomNavigationProps>): React.ReactElement => {
const [selectedIndex, setSelectedIndex] = React.useState(props.selectedIndex);

const onSelect = (index: number): void => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/ui/button/button.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {

describe('@button: component checks', () => {

const TestButton = (props?: ButtonProps): JSX.Element => (
const TestButton = (props?: ButtonProps): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down Expand Up @@ -62,14 +62,14 @@ I love Babel
});

it('should render components passed to accessoryLeft or accessoryRight props', () => {
const AccessoryLeft = (props?: Partial<ImageProps>): JSX.Element => (
const AccessoryLeft = (props?: Partial<ImageProps>): React.ReactElement => (
<Image
{...props}
source={{ uri: 'https://akveo.github.io/eva-icons/fill/png/128/star.png' }}
/>
);

const AccessoryRight = (props?: Partial<ImageProps>): JSX.Element => (
const AccessoryRight = (props?: Partial<ImageProps>): React.ReactElement => (
<Image
{...props}
source={{ uri: 'https://akveo.github.io/eva-icons/fill/png/128/home.png' }}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/buttonGroup/buttonGroup.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { Button } from '../button/button.component';

describe('@button-group: component checks', () => {

const TestButtonGroup = (props?: Partial<ButtonGroupProps>): JSX.Element => (
const TestButtonGroup = (props?: Partial<ButtonGroupProps>): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/calendar/baseCalendar.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ export abstract class BaseCalendarComponent<P, D = Date> extends React.Component
);
};

private renderDayPickerElement = (date: D, evaStyle): JSX.Element => {
private renderDayPickerElement = (date: D, evaStyle): React.ReactElement => {
return (
<>
<CalendarMonthHeader
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/card/card.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {

describe('@card: component checks', () => {

const TestCard = (props?: Partial<CardProps>): JSX.Element => (
const TestCard = (props?: Partial<CardProps>): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/checkbox/checkbox.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {

describe('@checkbox component checks', () => {

const TestCheckBox = (props?: CheckBoxProps): JSX.Element => (
const TestCheckBox = (props?: CheckBoxProps): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/drawer/drawer.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export class Drawer extends React.Component<DrawerProps> {
};
};

public render(): JSX.Element {
public render(): React.ReactElement {
const { eva, style, header, footer, ...menuProps } = this.props;
const evaStyle = this.getComponentStyle(eva.style);

Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/drawer/drawer.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {

describe('@drawer-item: component checks', () => {

const TestDrawerItem = (props?: DrawerItemProps): JSX.Element => (
const TestDrawerItem = (props?: DrawerItemProps): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down Expand Up @@ -148,7 +148,7 @@ describe('@drawer-item: component checks', () => {

describe('@drawer: component checks', () => {

const TestDrawer = (props?: DrawerProps): JSX.Element => (
const TestDrawer = (props?: DrawerProps): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/input/input.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe('@input: component checks', () => {
});

it('should render text passed to caption prop', () => {
const renderCaption = (): JSX.Element => (
const renderCaption = (): React.ReactElement => (
<Text>
I love Babel
</Text>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/layout/layout.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {

describe('@layout: component checks', () => {

const TestLayout = (props?: LayoutProps): JSX.Element => (
const TestLayout = (props?: LayoutProps): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/list/list.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {

describe('@list-item: component checks', () => {

const TestListItem = (props?: ListItemProps): JSX.Element => (
const TestListItem = (props?: ListItemProps): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/list/listItem.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class ListItem extends React.Component<ListItemProps> {
};
};

private renderTemplateChildren = (props: ListItemProps, evaStyle): JSX.Element => {
private renderTemplateChildren = (props: ListItemProps, evaStyle): React.ReactElement => {
return (
<>
<FalsyFC
Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/menu/menu.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jest.useFakeTimers();

describe('@menu-item: component checks', () => {

const TestMenuItem = (props?: MenuItemProps): JSX.Element => (
const TestMenuItem = (props?: MenuItemProps): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down Expand Up @@ -173,7 +173,7 @@ describe('@menu-item: component checks', () => {

describe('@menu: component checks', () => {

const TestMenu = (props: MenuProps): JSX.Element => (
const TestMenu = (props: MenuProps): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/modal/modal.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {

describe('@modal: component checks', () => {

const TestModal = (props: Partial<ModalProps>): JSX.Element => {
const TestModal = (props: Partial<ModalProps>): React.ReactElement => {
const [visible, setVisible] = React.useState(props.visible);
const [text, setText] = React.useState('I love Babel');

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/popover/popover.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('@popover: component checks', () => {
setVisible(!visible);
};

const AnchorButton = (): JSX.Element => (
const AnchorButton = (): React.ReactElement => (
<Button
testID='@popover/toggle-button'
title=''
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/radio/radio.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {

describe('@radio: component checks', () => {

const TestRadio = (props?: RadioProps): JSX.Element => (
const TestRadio = (props?: RadioProps): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/radioGroup/radioGroup.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Radio } from '../radio/radio.component';

describe('@radio-group: component checks', () => {

const TestRadioGroup = (props?: Partial<RadioGroupProps>): JSX.Element => {
const TestRadioGroup = (props?: Partial<RadioGroupProps>): React.ReactElement => {
const [selectedIndex, setSelectedIndex] = React.useState(props.selectedIndex);

const onCheckedChange = (index: number): void => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/select/select.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jest.mock('react-native', () => {

describe('@select-item: component checks', () => {

const TestSelectItem = (props?: SelectItemProps): JSX.Element => (
const TestSelectItem = (props?: SelectItemProps): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down
6 changes: 3 additions & 3 deletions src/components/ui/tab/tab.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { ReactTestInstance } from 'react-test-renderer';

describe('@tab: component checks', () => {

const TestTab = (props?: TabProps): JSX.Element => (
const TestTab = (props?: TabProps): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('@tab: component checks', () => {

describe('@tab-bar: component checks', () => {

const TestTabBar = (props?: Partial<TabBarProps>): JSX.Element => {
const TestTabBar = (props?: Partial<TabBarProps>): React.ReactElement => {
const [selectedIndex, setSelectedIndex] = React.useState(props.selectedIndex);

return (
Expand Down Expand Up @@ -193,7 +193,7 @@ describe('@tab-bar: component checks', () => {

describe('@tab-view: component checks', () => {

const TestTabView = (props?: TabViewProps): JSX.Element => (
const TestTabView = (props?: TabViewProps): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/text/text.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {

describe('@text: component checks', () => {

const TestText = (props?: TextProps): JSX.Element => (
const TestText = (props?: TextProps): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/toggle/toggle.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {

describe('@toggle: component checks', () => {

const TestToggle = (props?: ToggleProps): JSX.Element => (
const TestToggle = (props?: ToggleProps): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/topNavigation/topNavigation.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {

describe('@top-navigation-action: component checks', () => {

const TestTopNavigationAction = (props?: TopNavigationActionProps): JSX.Element => (
const TestTopNavigationAction = (props?: TopNavigationActionProps): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down Expand Up @@ -153,7 +153,7 @@ describe('@top-navigation-action: component checks', () => {

describe('@top-navigation: component checks', () => {

const TestTopNavigation = (props?: Partial<TopNavigationProps>): JSX.Element => (
const TestTopNavigation = (props?: Partial<TopNavigationProps>): React.ReactElement => (
<ApplicationProvider
mapping={mapping}
theme={light}
Expand Down
2 changes: 1 addition & 1 deletion src/showcases/components/button/buttonStates.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { StyleSheet } from 'react-native';
import { Button, Layout } from '@ui-kitten/components';

export const ButtonStatesShowcase = (): JSX.Element => (
export const ButtonStatesShowcase = (): React.ReactElement => (
<Layout
style={styles.container}
level='1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { StyleSheet } from 'react-native';
import { Layout, Tab, TabView, Text } from '@ui-kitten/components';

export const TabViewLazyLoadingShowcase = (): JSX.Element => {
export const TabViewLazyLoadingShowcase = (): React.ReactElement => {

const [selectedIndex, setSelectedIndex] = React.useState(0);

Expand Down

0 comments on commit 11fde70

Please sign in to comment.