Skip to content

Commit 9753334

Browse files
committed
chore: package.json re-arrangement and small typescript issues fixed
1 parent 046237e commit 9753334

File tree

8 files changed

+60
-168
lines changed

8 files changed

+60
-168
lines changed

docs/src/components/ScreenshotTabs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { JSX } from 'react';
1+
import React, { ReactNode } from 'react';
22

33
//@ts-ignore
44
import TabItem from '@theme/TabItem';
@@ -21,7 +21,7 @@ const ScreenshotTabs: React.FC<ScreenshotTabsProps> = ({
2121
screenshotData,
2222
baseUrl,
2323
}) => {
24-
const renderScreenhot = (src: string): JSX.Element => (
24+
const renderScreenhot = (src: string): ReactNode => (
2525
<img src={`${baseUrl}${src}`} className={getClassName(src)} />
2626
);
2727

docs/src/components/ThemeColorsTable.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { JSX } from 'react';
1+
import React, { ReactNode } from 'react';
22

33
//@ts-ignore
44
import Admonition from '@theme/Admonition';
@@ -13,11 +13,11 @@ import {
1313
getUniqueNestedKeys,
1414
} from '../utils/themeColors';
1515

16-
const getTableHeader = (keys: string[]): JSX.Element[] => {
16+
const getTableHeader = (keys: string[]): ReactNode[] => {
1717
return keys.map((key) => <th key={key}>{key}</th>);
1818
};
1919

20-
const getTableCell = (keys: string[], modes: DataObject): JSX.Element[] => {
20+
const getTableCell = (keys: string[], modes: DataObject): ReactNode[] => {
2121
return keys.map((key) => {
2222
const value = modes[key];
2323
if (typeof value === 'string') {
@@ -33,7 +33,7 @@ const FlatTable = ({
3333
}: {
3434
themeColorsData: DataObject;
3535
uniqueKeys: string[];
36-
}): JSX.Element => {
36+
}): ReactNode => {
3737
const rows = Object.keys(themeColorsData).map((mode) => {
3838
return (
3939
<tr key={`${mode}`}>
@@ -68,7 +68,7 @@ const TabbedTable = ({
6868
}: {
6969
themeColorsData: DataObject;
7070
uniqueKeys: string[];
71-
}): JSX.Element => {
71+
}): ReactNode => {
7272
const tabTableContent = Object.keys(themeColorsData).map((key) => {
7373
const modes = themeColorsData[key] as DataObject;
7474
const rows = Object.keys(modes).map((mode) => {
@@ -111,7 +111,7 @@ const ThemeColorsTable = ({
111111
}: {
112112
themeColorsData: DataObject;
113113
componentName: string;
114-
}): JSX.Element | null => {
114+
}): ReactNode | null => {
115115
const uniqueKeys = getUniqueNestedKeys(themeColorsData);
116116
const nestingLevel = getMaxNestedLevel(themeColorsData);
117117
const isFlatTable = nestingLevel === 1;

docs/src/utils/themes.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
argbFromHex,
33
themeFromSourceColor,
4-
//@ts-ignore
54
// eslint-disable-next-line import/no-unresolved
65
} from '@material/material-color-utilities';
76
import camelCase from 'camelcase';

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
},
5353
"dependencies": {
5454
"@callstack/react-theme-provider": "^3.0.9",
55-
"@react-native/babel-preset": "^0.82.1",
5655
"color": "^3.1.2",
5756
"use-latest-callback": "^0.2.3"
5857
},
@@ -63,6 +62,7 @@
6362
"@callstack/eslint-config": "^13.0.2",
6463
"@commitlint/config-conventional": "^8.3.4",
6564
"@react-native-vector-icons/material-design-icons": "^12.0.0",
65+
"@react-native/babel-preset": "^0.82.1",
6666
"@react-navigation/native": "^6.1.2",
6767
"@release-it/conventional-changelog": "^1.1.0",
6868
"@testing-library/jest-native": "^5.4.1",
@@ -92,7 +92,6 @@
9292
"husky": "^1.3.1",
9393
"jest": "^29.6.3",
9494
"jest-file-snapshot": "^0.3.2",
95-
"metro-react-native-babel-preset": "0.73.9",
9695
"react": "19.1.1",
9796
"react-dom": "18.3.1",
9897
"react-native": "0.82.1",

src/components/BottomNavigation/BottomNavigationRouteScreen.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { JSX } from 'react';
1+
import React, { ReactNode } from 'react';
22
import { Animated, Platform, View, ViewProps } from 'react-native';
33

44
interface Props extends ViewProps {
@@ -7,7 +7,7 @@ interface Props extends ViewProps {
77
}
88

99
class BottomNavigationRouteScreen extends React.Component<Props> {
10-
render(): JSX.Element {
10+
render(): ReactNode {
1111
const { style, index, children, visibility, ...rest } = this.props;
1212

1313
// On Web, the unfocused tab screens can still be clicked since they are transparent, but still there

src/components/Typography/AnimatedText.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { JSX } from 'react';
2+
import { ReactNode } from 'react';
33
import {
44
Animated,
55
I18nManager,
@@ -103,6 +103,6 @@ const styles = StyleSheet.create({
103103
});
104104

105105
export const customAnimatedText = <T,>() =>
106-
AnimatedText as (props: Props<T>) => JSX.Element;
106+
AnimatedText as (props: Props<T>) => ReactNode;
107107

108108
export default AnimatedText;

src/components/Typography/Text.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { JSX } from 'react';
2+
import { ReactNode } from 'react';
33
import {
44
I18nManager,
55
StyleProp,
@@ -178,7 +178,7 @@ const styles = StyleSheet.create({
178178

179179
type TextComponent<T> = (
180180
props: Props<T> & { ref?: React.RefObject<TextRef> }
181-
) => JSX.Element;
181+
) => ReactNode;
182182

183183
const Component = forwardRef(Text) as TextComponent<never>;
184184

0 commit comments

Comments
 (0)