Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b372fb2
Removed forwardRef from ShareTabParticipantsSelector.tsx
jakubkalinski0 Sep 19, 2025
ced3156
Removed forwardRef from AmountWithoutCurrencyInput.tsx
jakubkalinski0 Sep 19, 2025
0a85bde
CheckboxWithLabel.tsx
jakubkalinski0 Sep 19, 2025
484aac2
Removed forwardRef from ContextMenuItem.tsx
jakubkalinski0 Sep 19, 2025
e92bfab
Removed forwardRef from Countryselector.tsx
jakubkalinski0 Sep 19, 2025
450f974
Removed forwardRef from CurrencySelector.tsx
jakubkalinski0 Sep 19, 2025
78e716c
Removed forwardRef from FormScrollView.tsx
jakubkalinski0 Sep 19, 2025
a08967c
Removed forwardRef from HighlightableMenuItem.tsx
jakubkalinski0 Sep 21, 2025
9d6d600
Removed forwardRef from InteractiveStepSubHeader.tsx
jakubkalinski0 Sep 22, 2025
c1133fe
Removed forwardRef from InteractiveStepWrapper.tsx
jakubkalinski0 Sep 22, 2025
969a22d
Removed forwardRef from MagicCodeInput.tsx
jakubkalinski0 Sep 22, 2025
cc7838c
Removed forwardRef from PercentageForm.tsx
jakubkalinski0 Sep 22, 2025
18c6c98
Removed forwardRef from RadioButtons.tsx
jakubkalinski0 Sep 22, 2025
36401ad
Small code cleanup
jakubkalinski0 Sep 22, 2025
7841e73
Removed forwardRef from SingleChoiceQuestion.tsx
jakubkalinski0 Sep 22, 2025
709690b
Removed forwardRef from StateSelector.tsx
jakubkalinski0 Sep 22, 2025
fe67331
Removed forwardRef from TextLink.tsx
jakubkalinski0 Sep 22, 2025
cb7d981
Removed forwardRef from TimeModalPicker.tsx
jakubkalinski0 Sep 22, 2025
311aa07
Removed forwardRef from withToggleVisibilityView.tsx
jakubkalinski0 Sep 22, 2025
f87737f
Removed forwardRef from withViewportOffsetTop.tsx
jakubkalinski0 Sep 22, 2025
2eaa7ab
Removed forwardRef from ActionSheetAwareScrollView component
jakubkalinski0 Sep 22, 2025
dcf0798
Removed forwardRef from AddressSearch component
jakubkalinski0 Sep 22, 2025
e08814a
Removed forwardRef from AmountPicker component
jakubkalinski0 Sep 22, 2025
e4cd636
Removed forwardRef from AttachmentCarousel/Pager/index.tsx
jakubkalinski0 Sep 22, 2025
c8db1e8
Removed forwardRef from DatePicker component
jakubkalinski0 Sep 22, 2025
d002746
Fixed failing spellcheck
jakubkalinski0 Sep 23, 2025
f2d37c8
Removed unnecessary prop
jakubkalinski0 Oct 7, 2025
ec6d40f
Prettier run
jakubkalinski0 Oct 24, 2025
8157b1a
Merge branch 'main' into jakubkalinski0/Fix-console-errors-related-to…
jakubkalinski0 Oct 24, 2025
8325118
Merge branch 'main' into jakubkalinski0/Fix-console-errors-related-to…
jakubkalinski0 Nov 6, 2025
69e9ed3
Removed unused forwardRef import
jakubkalinski0 Nov 6, 2025
8f8f2e3
Merge branch 'main' into jakubkalinski0/Fix-console-errors-related-to…
jakubkalinski0 Nov 6, 2025
c0e0150
Merge branch 'main' into jakubkalinski0/Fix-console-errors-related-to…
jakubkalinski0 Nov 10, 2025
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
8 changes: 3 additions & 5 deletions src/components/ActionSheetAwareScrollView/index.ios.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React, {forwardRef, useCallback} from 'react';
// eslint-disable-next-line no-restricted-imports
import type {ScrollView} from 'react-native';
import React, {useCallback} from 'react';
import Reanimated, {useAnimatedRef, useAnimatedStyle} from 'react-native-reanimated';
import {Actions, ActionSheetAwareScrollViewContext, ActionSheetAwareScrollViewProvider} from './ActionSheetAwareScrollViewContext';
import type {ActionSheetAwareScrollViewProps, RenderActionSheetAwareScrollViewComponent} from './types';
import useActionSheetKeyboardSpacing from './useActionSheetKeyboardSpacing';

const ActionSheetAwareScrollView = forwardRef<ScrollView, ActionSheetAwareScrollViewProps>(({style, children, ...props}, ref) => {
function ActionSheetAwareScrollView({style, children, ref, ...props}: ActionSheetAwareScrollViewProps) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don’t see the benefit of this component anywhere.
i.e. #54764 test case is not working at all. (Also on main)
Can you find any example case where animation is working?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If this is not used, lets create an issue to remove it

const scrollViewAnimatedRef = useAnimatedRef<Reanimated.ScrollView>();

const onRef = useCallback(
Expand Down Expand Up @@ -38,7 +36,7 @@ const ActionSheetAwareScrollView = forwardRef<ScrollView, ActionSheetAwareScroll
{children}
</Reanimated.ScrollView>
);
});
}

export default ActionSheetAwareScrollView;

Expand Down
21 changes: 11 additions & 10 deletions src/components/ActionSheetAwareScrollView/index.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
// this whole file is just for other platforms
// iOS version has everything implemented
import React, {forwardRef} from 'react';
import React from 'react';
// eslint-disable-next-line no-restricted-imports
import {ScrollView} from 'react-native';
import {Actions, ActionSheetAwareScrollViewContext, ActionSheetAwareScrollViewProvider} from './ActionSheetAwareScrollViewContext';
import type {ActionSheetAwareScrollViewProps, RenderActionSheetAwareScrollViewComponent} from './types';

const ActionSheetAwareScrollView = forwardRef<ScrollView, ActionSheetAwareScrollViewProps>((props, ref) => (
<ScrollView
ref={ref}
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
>
{props.children}
</ScrollView>
));
function ActionSheetAwareScrollView(props: ActionSheetAwareScrollViewProps) {
return (
<ScrollView
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
>
{props.children}
</ScrollView>
);
}

export default ActionSheetAwareScrollView;

Expand Down
10 changes: 7 additions & 3 deletions src/components/ActionSheetAwareScrollView/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import type {PropsWithChildren} from 'react';
import type {ScrollViewProps} from 'react-native';
import type {PropsWithChildren, Ref} from 'react';
// eslint-disable-next-line no-restricted-imports
import type {ScrollView, ScrollViewProps} from 'react-native';

type ActionSheetAwareScrollViewProps = PropsWithChildren<ScrollViewProps>;
type ActionSheetAwareScrollViewAnimationProps = {
ref?: Ref<ScrollView>;
};
type ActionSheetAwareScrollViewProps = PropsWithChildren<ScrollViewProps> & ActionSheetAwareScrollViewAnimationProps;
type RenderActionSheetAwareScrollViewComponent = ((props: ActionSheetAwareScrollViewProps) => React.ReactElement<ScrollViewProps>) | undefined;
export type {ActionSheetAwareScrollViewProps, RenderActionSheetAwareScrollViewComponent};
71 changes: 34 additions & 37 deletions src/components/AddressSearch/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {forwardRef, useEffect, useMemo, useRef, useState} from 'react';
import type {ForwardedRef} from 'react';
import React, {useEffect, useMemo, useRef, useState} from 'react';
import {Keyboard, LogBox, View} from 'react-native';
import type {LayoutChangeEvent} from 'react-native';
import {GooglePlacesAutocomplete} from 'react-native-google-places-autocomplete';
Expand Down Expand Up @@ -49,40 +48,38 @@ function isPlaceMatchForSearch(search: string, place: PredefinedPlace): boolean
// VirtualizedList component with a VirtualizedList-backed instead
LogBox.ignoreLogs(['VirtualizedLists should never be nested']);

function AddressSearch(
{
canUseCurrentLocation = false,
containerStyles,
defaultValue,
errorText = '',
hint = '',
inputID,
limitSearchesToCountry,
label,
maxInputLength,
onFocus,
onBlur,
onInputChange,
onPress,
onCountryChange,
predefinedPlaces = [],
renamedInputKeys = {
street: 'addressStreet',
street2: 'addressStreet2',
city: 'addressCity',
state: 'addressState',
zipCode: 'addressZipCode',
lat: 'addressLat',
lng: 'addressLng',
},
resultTypes = 'address',
shouldSaveDraft = false,
value,
locationBias,
caretHidden,
}: AddressSearchProps,
ref: ForwardedRef<HTMLElement>,
) {
function AddressSearch({
canUseCurrentLocation = false,
containerStyles,
defaultValue,
errorText = '',
hint = '',
inputID,
limitSearchesToCountry,
label,
maxInputLength,
onFocus,
onBlur,
onInputChange,
onPress,
onCountryChange,
predefinedPlaces = [],
renamedInputKeys = {
street: 'addressStreet',
street2: 'addressStreet2',
city: 'addressCity',
state: 'addressState',
zipCode: 'addressZipCode',
lat: 'addressLat',
lng: 'addressLng',
},
resultTypes = 'address',
shouldSaveDraft = false,
value,
locationBias,
caretHidden,
ref,
}: AddressSearchProps) {
const theme = useTheme();
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
Expand Down Expand Up @@ -490,6 +487,6 @@ function AddressSearch(

AddressSearch.displayName = 'AddressSearchWithRef';

export default forwardRef(AddressSearch);
export default AddressSearch;

export type {AddressSearchProps};
5 changes: 4 additions & 1 deletion src/components/AddressSearch/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {RefObject} from 'react';
import type {ForwardedRef, RefObject} from 'react';
import type {BlurEvent, StyleProp, View, ViewStyle} from 'react-native';
import type {Place} from 'react-native-google-places-autocomplete';
import type {Country} from '@src/CONST';
Expand Down Expand Up @@ -90,6 +90,9 @@ type AddressSearchProps = {

/** If true, caret is hidden. The default value is false. */
caretHidden?: boolean;

/** Reference to the outer element */
ref?: ForwardedRef<HTMLElement>;
};

type IsCurrentTargetInsideContainerType = (event: FocusEvent | BlurEvent, containerRef: RefObject<View | HTMLElement | null>) => boolean;
Expand Down
9 changes: 4 additions & 5 deletions src/components/AmountPicker/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {forwardRef, useState} from 'react';
import type {ForwardedRef} from 'react';
import React, {useState} from 'react';
import {View} from 'react-native';
import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
import blurActiveElement from '@libs/Accessibility/blurActiveElement';
Expand All @@ -8,7 +7,7 @@ import callOrReturn from '@src/types/utils/callOrReturn';
import AmountSelectorModal from './AmountSelectorModal';
import type {AmountPickerProps} from './types';

function AmountPicker({value, description, title, errorText = '', onInputChange, furtherDetails, rightLabel, ...rest}: AmountPickerProps, forwardedRef: ForwardedRef<View>) {
function AmountPicker({value, description, title, errorText = '', onInputChange, furtherDetails, rightLabel, ref, ...rest}: AmountPickerProps) {
const [isPickerVisible, setIsPickerVisible] = useState(false);

const showPickerModal = () => {
Expand All @@ -31,7 +30,7 @@ function AmountPicker({value, description, title, errorText = '', onInputChange,
return (
<View>
<MenuItemWithTopDescription
ref={forwardedRef}
ref={ref}
Comment thread
jakubkalinski0 marked this conversation as resolved.
shouldShowRightIcon
title={callOrReturn(title, value)}
description={description}
Expand All @@ -56,4 +55,4 @@ function AmountPicker({value, description, title, errorText = '', onInputChange,

AmountPicker.displayName = 'AmountPicker';

export default forwardRef(AmountPicker);
export default AmountPicker;
5 changes: 5 additions & 0 deletions src/components/AmountPicker/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type {ForwardedRef} from 'react';
import type {View} from 'react-native';
Comment thread
jakubkalinski0 marked this conversation as resolved.
import type {MenuItemBaseProps} from '@components/MenuItem';
import type {NumberWithSymbolFormProps} from '@components/NumberWithSymbolForm';

Expand Down Expand Up @@ -47,6 +49,9 @@ type AmountPickerProps = {

/** Whether to show the tooltip text */
shouldShowTooltips?: boolean;

/** Reference to the outer element */
ref?: ForwardedRef<View>;
} & Pick<MenuItemBaseProps, 'rightLabel' | 'description'> &
Pick<
NumberWithSymbolFormProps,
Expand Down
24 changes: 17 additions & 7 deletions src/components/AmountWithoutCurrencyInput.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React, {useCallback, useMemo} from 'react';
import type {ForwardedRef} from 'react';
import useLocalize from '@hooks/useLocalize';
import getAmountInputKeyboard from '@libs/getAmountInputKeyboard';
import {handleNegativeAmountFlipping, replaceAllDigits, replaceCommasWithPeriod, stripSpacesFromAmount} from '@libs/MoneyRequestUtils';
import TextInput from './TextInput';
import type {BaseTextInputProps, BaseTextInputRef} from './TextInput/BaseTextInput/types';
import type {BaseTextInputProps} from './TextInput/BaseTextInput/types';

type AmountFormProps = {
/** Amount supplied by the FormProvider */
Expand All @@ -23,10 +22,21 @@ type AmountFormProps = {
toggleNegative?: () => void;
} & Partial<BaseTextInputProps>;

function AmountWithoutCurrencyInput(
{value: amount, shouldAllowNegative = false, inputID, name, defaultValue, accessibilityLabel, role, label, onInputChange, allowFlippingAmount, toggleNegative, ...rest}: AmountFormProps,
ref: ForwardedRef<BaseTextInputRef>,
) {
function AmountWithoutCurrencyInput({
value: amount,
shouldAllowNegative = false,
inputID,
name,
defaultValue,
accessibilityLabel,
role,
label,
onInputChange,
allowFlippingAmount,
toggleNegative,
ref,
...rest
}: AmountFormProps) {
const {toLocaleDigit} = useLocalize();
const separator = useMemo(
() =>
Expand Down Expand Up @@ -94,4 +104,4 @@ function AmountWithoutCurrencyInput(

AmountWithoutCurrencyInput.displayName = 'AmountWithoutCurrencyInput';

export default React.forwardRef(AmountWithoutCurrencyInput);
export default AmountWithoutCurrencyInput;
10 changes: 5 additions & 5 deletions src/components/Attachments/AttachmentCarousel/Pager/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ type AttachmentCarouselPagerProps = {

/** Callback for attachment errors */
onAttachmentError?: (source: AttachmentSource) => void;

/** Reference to the outer element */
ref?: ForwardedRef<AttachmentCarouselPagerHandle>;
};

function AttachmentCarouselPager(
{items, activeAttachmentID, initialPage, setShouldShowArrows, onPageSelected, onSwipeDown, reportID, onAttachmentError}: AttachmentCarouselPagerProps,
ref: ForwardedRef<AttachmentCarouselPagerHandle>,
) {
function AttachmentCarouselPager({items, activeAttachmentID, initialPage, setShouldShowArrows, onPageSelected, onSwipeDown, reportID, onAttachmentError, ref}: AttachmentCarouselPagerProps) {
const {handleTap, handleScaleChange, isScrollEnabled} = useCarouselContextEvents(setShouldShowArrows);
const styles = useThemeStyles();
const pagerRef = useRef<PagerView>(null);
Expand Down Expand Up @@ -153,5 +153,5 @@ function AttachmentCarouselPager(
}
AttachmentCarouselPager.displayName = 'AttachmentCarouselPager';

export default React.forwardRef(AttachmentCarouselPager);
export default AttachmentCarouselPager;
export type {AttachmentCarouselPagerHandle};
21 changes: 16 additions & 5 deletions src/components/CheckboxWithLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,23 @@ type CheckboxWithLabelProps = RequiredLabelProps & {

/** An accessibility label for the checkbox */
accessibilityLabel?: string;

/** Reference to the outer element */
ref?: ForwardedRef<View>;
};

function CheckboxWithLabel(
{errorText = '', isChecked: isCheckedProp = false, defaultValue = false, onInputChange = () => {}, LabelComponent, label, accessibilityLabel, style, value}: CheckboxWithLabelProps,
ref: ForwardedRef<View>,
) {
function CheckboxWithLabel({
errorText = '',
isChecked: isCheckedProp = false,
defaultValue = false,
onInputChange = () => {},
LabelComponent,
label,
accessibilityLabel,
style,
value,
ref,
}: CheckboxWithLabelProps) {
const styles = useThemeStyles();
// We need to pick the first value that is strictly a boolean
// https://github.com/Expensify/App/issues/16885#issuecomment-1520846065
Expand Down Expand Up @@ -106,6 +117,6 @@ function CheckboxWithLabel(

CheckboxWithLabel.displayName = 'CheckboxWithLabel';

export default React.forwardRef(CheckboxWithLabel);
export default CheckboxWithLabel;

export type {CheckboxWithLabelProps};
49 changes: 25 additions & 24 deletions src/components/ContextMenuItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {ForwardedRef} from 'react';
import React, {forwardRef, useImperativeHandle} from 'react';
import React, {useImperativeHandle} from 'react';
import type {GestureResponderEvent, StyleProp, View, ViewStyle} from 'react-native';
import useStyleUtils from '@hooks/useStyleUtils';
import useThemeStyles from '@hooks/useThemeStyles';
Expand Down Expand Up @@ -61,34 +61,35 @@ type ContextMenuItemProps = {

/** Whether the menu item should show loading icon */
shouldShowLoadingSpinnerIcon?: boolean;

/** Reference to the outer element */
ref?: ForwardedRef<ContextMenuItemHandle>;
};

type ContextMenuItemHandle = {
triggerPressAndUpdateSuccess?: () => void;
};

function ContextMenuItem(
{
onPress,
successIcon,
successText = '',
icon,
text,
isMini = false,
description = '',
isAnonymousAction = false,
isFocused = false,
shouldLimitWidth = true,
wrapperStyle,
shouldPreventDefaultFocusOnPress = true,
buttonRef = {current: null},
onFocus = () => {},
onBlur = () => {},
disabled = false,
shouldShowLoadingSpinnerIcon = false,
}: ContextMenuItemProps,
ref: ForwardedRef<ContextMenuItemHandle>,
) {
function ContextMenuItem({
onPress,
successIcon,
successText = '',
icon,
text,
isMini = false,
description = '',
isAnonymousAction = false,
isFocused = false,
shouldLimitWidth = true,
wrapperStyle,
shouldPreventDefaultFocusOnPress = true,
buttonRef = {current: null},
onFocus = () => {},
onBlur = () => {},
disabled = false,
shouldShowLoadingSpinnerIcon = false,
ref,
}: ContextMenuItemProps) {
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
const {windowWidth} = useWindowDimensions();
Expand Down Expand Up @@ -151,5 +152,5 @@ function ContextMenuItem(

ContextMenuItem.displayName = 'ContextMenuItem';

export default forwardRef(ContextMenuItem);
export default ContextMenuItem;
Comment thread
jakubkalinski0 marked this conversation as resolved.
export type {ContextMenuItemHandle};
Loading
Loading