Skip to content

Commit 303f80b

Browse files
committed
refactor: remove React.FC
1 parent 6427e59 commit 303f80b

File tree

101 files changed

+1447
-1456
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1447
-1456
lines changed

.eslintrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,12 @@ module.exports = {
2424
'@typescript-eslint/ban-types': 'off',
2525
'@typescript-eslint/ban-ts-comment': 'off',
2626
'@typescript-eslint/no-var-requires': 'off',
27+
'@typescript-eslint/no-unused-vars': [
28+
'error',
29+
{
30+
'argsIgnorePattern': '^_',
31+
'varsIgnorePattern': '^_',
32+
},
33+
],
2734
},
2835
};

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@
6565
"typedoc": "^0.23.7",
6666
"typescript": "^4.5.4"
6767
},
68-
"resolutions": {
69-
"@types/react": "^17"
70-
},
7168
"jest": {
7269
"testEnvironment": "node",
7370
"moduleFileExtensions": [

packages/uikit-chat-hooks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"@sendbird/uikit-utils": "1.0.0"
4242
},
4343
"devDependencies": {
44-
"@types/react": "17.0.2",
44+
"@types/react": "*",
4545
"react": "^16.13.1",
4646
"react-native-builder-bob": "^0.18.0",
4747
"typescript": "^4.1.3"

packages/uikit-react-native-foundation/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
"@sendbird/uikit-utils": "1.0.0"
4242
},
4343
"devDependencies": {
44-
"@types/react": "17.0.2",
45-
"@types/react-native": "^0.66.15",
44+
"@types/react": "*",
45+
"@types/react-native": "*",
4646
"react": "17.0.2",
4747
"react-native": "0.66.4",
4848
"react-native-builder-bob": "^0.18.0",

packages/uikit-react-native-foundation/src/components/Image/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type React from 'react';
21
import type { ImageProps as NativeImageProps } from 'react-native';
32
import { NativeModules } from 'react-native';
43

@@ -8,7 +7,7 @@ export interface SendbirdImageProps extends Omit<NativeImageProps, 'onLoad' | 'o
87
tintColor?: string;
98
}
109

11-
export type SendbirdImageComponent = React.FC<SendbirdImageProps>;
10+
export type SendbirdImageComponent = (props: SendbirdImageProps) => JSX.Element;
1211

1312
function getImageModule(): SendbirdImageComponent {
1413
const hasFastImage = Boolean(NativeModules.FastImageView);

packages/uikit-react-native-foundation/src/styles/HeaderStyleContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ export const HeaderStyleContext = React.createContext<HeaderStyleContextType>({
2929
});
3030

3131
type Props = Pick<HeaderStyleContextType, 'statusBarTranslucent' | 'defaultTitleAlign' | 'HeaderComponent'>;
32-
export const HeaderStyleProvider: React.FC<Props> = ({
32+
export const HeaderStyleProvider = ({
3333
children,
3434
HeaderComponent = () => null,
3535
defaultTitleAlign,
3636
statusBarTranslucent,
37-
}) => {
37+
}: React.PropsWithChildren<Props>) => {
3838
const { top } = useSafeAreaInsets();
3939

4040
return (

packages/uikit-react-native-foundation/src/theme/UIKitThemeProvider.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ import type { UIKitTheme } from '../types';
44
import LightUIKitTheme from './LightUIKitTheme';
55
import UIKitThemeContext from './UIKitThemeContext';
66

7-
type Props = { theme?: UIKitTheme };
8-
const UIKitThemeProvider: React.FC<Props> = ({ children, theme = LightUIKitTheme }) => {
7+
type Props = React.PropsWithChildren<{
8+
theme?: UIKitTheme;
9+
}>;
10+
const UIKitThemeProvider = ({ children, theme = LightUIKitTheme }: Props) => {
911
return <UIKitThemeContext.Provider value={theme}>{children}</UIKitThemeContext.Provider>;
1012
};
1113

packages/uikit-react-native-foundation/src/ui/ActionMenu/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type Props = {
2626
onError?: (error: unknown) => void;
2727
onDismiss?: () => void;
2828
} & ActionMenuItem;
29-
const ActionMenu: React.FC<Props> = ({ visible, onHide, onError, onDismiss, title, menuItems }) => {
29+
const ActionMenu = ({ visible, onHide, onError, onDismiss, title, menuItems }: Props) => {
3030
const { statusBarTranslucent } = useHeaderStyle();
3131
const { colors } = useUIKitTheme();
3232
const [pending, setPending] = useState(false);

packages/uikit-react-native-foundation/src/ui/Alert/index.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,7 @@ type Props = {
2020
onHide: () => void;
2121
onDismiss?: () => void;
2222
} & AlertItem;
23-
const Alert: React.FC<Props> = ({
24-
onDismiss,
25-
visible,
26-
onHide,
27-
title = '',
28-
message = '',
29-
buttons = [{ text: 'OK' }],
30-
}) => {
23+
const Alert = ({ onDismiss, visible, onHide, title = '', message = '', buttons = [{ text: 'OK' }] }: Props) => {
3124
const { statusBarTranslucent } = useHeaderStyle();
3225
const { colors } = useUIKitTheme();
3326

packages/uikit-react-native-foundation/src/ui/Avatar/AvatarGroup.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ import { StyleProp, View, ViewStyle } from 'react-native';
33

44
const MAX = 4;
55

6-
type Props = { size?: number; containerStyle?: StyleProp<ViewStyle> };
7-
const AvatarGroup: React.FC<Props> = ({ children, containerStyle, size = 56 }) => {
6+
type Props = React.PropsWithChildren<{
7+
size?: number;
8+
containerStyle?: StyleProp<ViewStyle>;
9+
}>;
10+
const AvatarGroup = ({ children, containerStyle, size = 56 }: Props) => {
811
const childAmount = React.Children.count(children);
912

1013
if (childAmount === 0) {

0 commit comments

Comments
 (0)