Skip to content
Open
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
1 change: 1 addition & 0 deletions docs/src/components/DynamicColorTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useState, ReactNode } from 'react';

import Color from 'color';
//@ts-ignore
// eslint-disable-next-line import/no-unresolved
import { BlockPicker } from 'react-color';

import Switch from './Switch';
Expand Down
4 changes: 2 additions & 2 deletions docs/src/components/ScreenshotTabs.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { ReactNode } from 'react';

//@ts-ignore
import TabItem from '@theme/TabItem';
Expand All @@ -21,7 +21,7 @@ const ScreenshotTabs: React.FC<ScreenshotTabsProps> = ({
screenshotData,
baseUrl,
}) => {
const renderScreenhot = (src: string): JSX.Element => (
const renderScreenhot = (src: string): ReactNode => (
<img src={`${baseUrl}${src}`} className={getClassName(src)} />
);

Expand Down
12 changes: 6 additions & 6 deletions docs/src/components/ThemeColorsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { ReactNode } from 'react';

//@ts-ignore
import Admonition from '@theme/Admonition';
Expand All @@ -13,11 +13,11 @@ import {
getUniqueNestedKeys,
} from '../utils/themeColors';

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

const getTableCell = (keys: string[], modes: DataObject): JSX.Element[] => {
const getTableCell = (keys: string[], modes: DataObject): ReactNode[] => {
return keys.map((key) => {
const value = modes[key];
if (typeof value === 'string') {
Expand All @@ -33,7 +33,7 @@ const FlatTable = ({
}: {
themeColorsData: DataObject;
uniqueKeys: string[];
}): JSX.Element => {
}): ReactNode => {
const rows = Object.keys(themeColorsData).map((mode) => {
return (
<tr key={`${mode}`}>
Expand Down Expand Up @@ -68,7 +68,7 @@ const TabbedTable = ({
}: {
themeColorsData: DataObject;
uniqueKeys: string[];
}): JSX.Element => {
}): ReactNode => {
const tabTableContent = Object.keys(themeColorsData).map((key) => {
const modes = themeColorsData[key] as DataObject;
const rows = Object.keys(modes).map((mode) => {
Expand Down Expand Up @@ -111,7 +111,7 @@ const ThemeColorsTable = ({
}: {
themeColorsData: DataObject;
componentName: string;
}): JSX.Element | null => {
}): ReactNode | null => {
const uniqueKeys = getUniqueNestedKeys(themeColorsData);
const nestingLevel = getMaxNestedLevel(themeColorsData);
const isFlatTable = nestingLevel === 1;
Expand Down
2 changes: 1 addition & 1 deletion docs/src/utils/themes.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
argbFromHex,
themeFromSourceColor,
//@ts-ignore
// eslint-disable-next-line import/no-unresolved

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[tiny q] - Just checking, do we still need the // @ts-ignore since there’s already an ESLint disable on the next line?

And do we know the reason for all the ESLint disables here? Trying to understand whether this is expected or if we’re missing something.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for ts-ignore, ES lint disable next line is enough

} from '@material/material-color-utilities';
import camelCase from 'camelcase';
import Color from 'color';
Expand Down
41 changes: 21 additions & 20 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,43 @@
"web": "EXPO_NO_TYPESCRIPT_SETUP=1 expo start --web"
},
"dependencies": {
"@expo/vector-icons": "^14.1.0",
"@expo/vector-icons": "^15.0.2",
"@expo/webpack-config": "~19.0.1",
"@pchmn/expo-material3-theme": "^1.3.2",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-async-storage/async-storage": "2.2.0",
"@react-native-masked-view/masked-view": "0.3.2",
"@react-navigation/bottom-tabs": "^7.3.10",
"@react-navigation/drawer": "^7.3.9",
"@react-navigation/native": "^7.1.6",
"@react-navigation/stack": "^7.2.10",
"expo": "~52.0.46",
"expo-crypto": "~14.0.2",
"expo-dev-client": "~5.0.20",
"expo-font": "~13.0.4",
"expo-keep-awake": "~14.0.3",
"expo-splash-screen": "~0.29.24",
"expo-status-bar": "~2.0.1",
"expo-updates": "~0.27.4",
"expo": "^54.0.0",
"expo-crypto": "~15.0.7",
"expo-dev-client": "~6.0.14",
"expo-font": "~14.0.9",
"expo-keep-awake": "~15.0.7",
"expo-splash-screen": "~31.0.10",
"expo-status-bar": "~3.0.8",
"expo-updates": "~29.0.12",
"file-loader": "^6.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-native": "0.77.2",
"react-native-gesture-handler": "~2.22.0",
"react": "19.1.0",
"react-dom": "19.1.0",
"react-native": "0.81.4",
"react-native-gesture-handler": "~2.28.0",
"react-native-monorepo-config": "^0.1.6",
"react-native-reanimated": "~3.16.7",
"react-native-safe-area-context": "5.1.0",
"react-native-screens": "~4.8.0",
"react-native-web": "~0.19.13",
"react-native-reanimated": "~4.1.1",
"react-native-safe-area-context": "~5.6.0",
"react-native-screens": "~4.16.0",
"react-native-web": "^0.21.0",
"react-native-worklets": "0.5.1",
"typeface-roboto": "^1.1.13"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"babel-plugin-module-resolver": "^5.0.0",
"babel-preset-expo": "~12.0.0",
"babel-preset-expo": "~54.0.0",
"url-loader": "^4.1.1"
},
"engines": {
"node": ">=18"
"node": ">=20"
}
}
10 changes: 2 additions & 8 deletions example/src/Examples/AnimatedFABExample/CustomFAB.tsx

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat! 🔥

Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import React from 'react';
import {
Animated,
Platform,
StyleProp,
StyleSheet,
ViewStyle,
} from 'react-native';
import { Animated, Platform, StyleSheet, ViewStyle } from 'react-native';

import { AnimatedFAB } from 'react-native-paper';

Expand All @@ -18,7 +12,7 @@ type CustomFABProps = {
label: string;
animateFrom: 'left' | 'right';
iconMode?: 'static' | 'dynamic';
style?: StyleProp<ViewStyle>;
style?: ViewStyle;
};

const CustomFAB = ({
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,17 @@
"@callstack/eslint-config": "^13.0.2",
"@commitlint/config-conventional": "^8.3.4",
"@react-native-vector-icons/material-design-icons": "^12.0.0",
"@react-native/babel-preset": "^0.82.1",
"@react-navigation/native": "^6.1.2",
"@release-it/conventional-changelog": "^1.1.0",
"@testing-library/jest-native": "^5.4.1",
"@testing-library/react-native": "11.5.0",
"@types/color": "^3.0.0",
"@types/jest": "^29.2.1",
"@types/node": "^13.1.0",
"@types/react-dom": "^18.3.1",
"@types/react-dom": "^19.1.1",
"@types/react-native-vector-icons": "^6.4.18",
"@types/react-test-renderer": "^18.3.0",
"@types/react-test-renderer": "^19.1.0",
"@typescript-eslint/eslint-plugin": "^5.41.0",
"@typescript-eslint/parser": "^5.41.0",
"all-contributors-cli": "^6.24.0",
Expand All @@ -91,16 +92,15 @@
"husky": "^1.3.1",
"jest": "^29.6.3",
"jest-file-snapshot": "^0.3.2",
"metro-react-native-babel-preset": "0.73.9",
"react": "18.3.1",
"react": "19.1.1",
"react-dom": "18.3.1",
"react-native": "0.77.0",
"react-native": "0.82.1",
"react-native-builder-bob": "^0.21.3",
"react-native-safe-area-context": "5.1.0",
"react-test-renderer": "18.3.1",
"react-native-safe-area-context": "5.5.2",
"react-test-renderer": "19.1.1",
"release-it": "^13.4.0",
"rimraf": "^3.0.2",
"typescript": "5.0.4"
"typescript": "5.8.3"
},
"peerDependencies": {
"react": "*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { ReactNode } from 'react';
import { Animated, Platform, View, ViewProps } from 'react-native';

interface Props extends ViewProps {
Expand All @@ -7,7 +7,7 @@ interface Props extends ViewProps {
}

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

// On Web, the unfocused tab screens can still be clicked since they are transparent, but still there
Expand Down
20 changes: 8 additions & 12 deletions src/components/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,9 @@ const Menu = ({
easing: EASING,
useNativeDriver: true,
}),
]).start(({ finished }) => {
if (finished) {
focusFirstDOMNode(menuRef.current);
prevRendered.current = true;
}
]).start(() => {
focusFirstDOMNode(menuRef.current);
prevRendered.current = true;
});
}, [anchor, attachListeners, measureAnchorLayout, theme]);

Expand All @@ -377,13 +375,11 @@ const Menu = ({
duration: ANIMATION_DURATION * animation.scale,
easing: EASING,
useNativeDriver: true,
}).start(({ finished }) => {
if (finished) {
setMenuLayout({ width: 0, height: 0 });
setRendered(false);
prevRendered.current = false;
focusFirstDOMNode(anchorRef.current);
}
}).start(() => {
setMenuLayout({ width: 0, height: 0 });
setRendered(false);
prevRendered.current = false;
focusFirstDOMNode(anchorRef.current);
});
}, [removeListeners, theme]);

Expand Down
3 changes: 2 additions & 1 deletion src/components/Typography/AnimatedText.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';
import { ReactNode } from 'react';
import {
Animated,
I18nManager,
Expand Down Expand Up @@ -102,6 +103,6 @@ const styles = StyleSheet.create({
});

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

export default AnimatedText;
3 changes: 2 additions & 1 deletion src/components/Typography/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';
import { ReactNode } from 'react';
import {
I18nManager,
StyleProp,
Expand Down Expand Up @@ -177,7 +178,7 @@ const styles = StyleSheet.create({

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

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

Expand Down
60 changes: 26 additions & 34 deletions src/components/__tests__/Appbar/__snapshots__/Appbar.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -565,23 +565,19 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
<View
collapsable={false}
style={
[
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
{
"opacity": 1,
"transform": [
{
"rotate": "0deg",
},
],
},
]
{
"bottom": 0,
"left": 0,
"opacity": 1,
"position": "absolute",
"right": 0,
"top": 0,
"transform": [
{
"rotate": "0deg",
},
],
}
}
testID="cross-fade-icon-current"
>
Expand Down Expand Up @@ -812,23 +808,19 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
<View
collapsable={false}
style={
[
{
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
{
"opacity": 1,
"transform": [
{
"rotate": "0deg",
},
],
},
]
{
"bottom": 0,
"left": 0,
"opacity": 1,
"position": "absolute",
"right": 0,
"top": 0,
"transform": [
{
"rotate": "0deg",
},
],
}
}
testID="cross-fade-icon-current"
>
Expand Down
5 changes: 0 additions & 5 deletions src/components/__tests__/Dialog.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ import { act, fireEvent, render } from '@testing-library/react-native';
import Dialog from '../../components/Dialog/Dialog';
import Button from '../Button/Button';

jest.mock('react-native/Libraries/Utilities/BackHandler', () =>
// eslint-disable-next-line jest/no-mocks-import
require('react-native/Libraries/Utilities/__mocks__/BackHandler')
);

interface BackHandlerStatic extends RNBackHandlerStatic {
mockPressBack(): void;
}
Expand Down
Loading