Skip to content

Commit bce653c

Browse files
authored
Merge pull request #32 from sendbird/fix/types-react
refactor: removed React.FC (UIKIT-2042)
2 parents 6427e59 + 9183d69 commit bce653c

File tree

103 files changed

+1527
-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.

103 files changed

+1527
-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
};

lerna.json

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,76 @@
1414
},
1515
"version": {
1616
"conventionalCommits": true,
17+
"changelogPreset": {
18+
"name": "conventional-changelog-conventionalcommits",
19+
"types": [
20+
{
21+
"type": "feat",
22+
"section": "Features"
23+
},
24+
{
25+
"type": "feature",
26+
"section": "Features"
27+
},
28+
{
29+
"type": "fix",
30+
"section": "Bug Fixes"
31+
},
32+
{
33+
"type": "refactor",
34+
"section": "Improvements"
35+
},
36+
{
37+
"type": "enhancement",
38+
"section": "Improvements"
39+
},
40+
{
41+
"type": "perf",
42+
"section": "Improvements"
43+
},
44+
{
45+
"type": "docs",
46+
"section": "Documentation"
47+
},
48+
{
49+
"type": "revert",
50+
"section": "Reverts",
51+
"hidden": true
52+
},
53+
{
54+
"type": "style",
55+
"section": "Styles",
56+
"hidden": true
57+
},
58+
{
59+
"type": "chore",
60+
"section": "Miscellaneous Chores",
61+
"hidden": true
62+
},
63+
{
64+
"type": "test",
65+
"section": "Tests",
66+
"hidden": true
67+
},
68+
{
69+
"type": "build",
70+
"section": "Build System",
71+
"hidden": true
72+
},
73+
{
74+
"type": "ci",
75+
"section": "Continuous Integration",
76+
"hidden": true
77+
}
78+
],
79+
"issuePrefixes": [
80+
"#"
81+
],
82+
"issueUrlFormat": "{{host}}/{{owner}}/{{repository}}/issues/{{id}}",
83+
"commitUrlFormat": "{{host}}/{{owner}}/{{repository}}/commit/{{hash}}",
84+
"compareUrlFormat": "{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}",
85+
"userUrlFormat": "{{host}}/{{user}}"
86+
},
1787
"exact": true,
1888
"gitRemote": "origin",
1989
"message": "chore(release): release packages %s"

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"@typescript-eslint/parser": "^5.9.1",
4949
"babel-jest": "^27.4.6",
5050
"chalk": "^4",
51+
"conventional-changelog-conventionalcommits": "^5.0.0",
5152
"del-cli": "^4.0.1",
5253
"eslint": "^8.6.0",
5354
"eslint-config-prettier": "^8.5.0",
@@ -65,9 +66,6 @@
6566
"typedoc": "^0.23.7",
6667
"typescript": "^4.5.4"
6768
},
68-
"resolutions": {
69-
"@types/react": "^17"
70-
},
7169
"jest": {
7270
"testEnvironment": "node",
7371
"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

0 commit comments

Comments
 (0)