Page MenuHomePhabricator

D10000.id33884.diff
No OneTemporary

D10000.id33884.diff

diff --git a/native/account/registration/registration-text-input.react.js b/native/account/registration/registration-text-input.react.js
--- a/native/account/registration/registration-text-input.react.js
+++ b/native/account/registration/registration-text-input.react.js
@@ -3,6 +3,8 @@
import * as React from 'react';
import { TextInput } from 'react-native';
+import type { ReactRefSetter } from 'lib/types/react-types.js';
+
import {
useStyles,
useColors,
@@ -11,7 +13,10 @@
type Props = React.ElementConfig<typeof TextInput>;
-function ForwardedRegistrationTextInput(props: Props, ref): React.Node {
+function ForwardedRegistrationTextInput(
+ props: Props,
+ ref: ReactRefSetter<React.ElementRef<typeof TextInput>>,
+): React.Node {
const {
onFocus,
onBlur,
diff --git a/native/bottom-sheet/bottom-sheet.react.js b/native/bottom-sheet/bottom-sheet.react.js
--- a/native/bottom-sheet/bottom-sheet.react.js
+++ b/native/bottom-sheet/bottom-sheet.react.js
@@ -4,6 +4,8 @@
import invariant from 'invariant';
import * as React from 'react';
+import type { ReactRefSetter } from 'lib/types/react-types.js';
+
import BottomSheetBackdrop from './bottom-sheet-backdrop.react.js';
import BottomSheetHandle from './bottom-sheet-handle.react.js';
import { BottomSheetContext } from './bottom-sheet-provider.react.js';
@@ -16,7 +18,7 @@
function ForwardedBottomSheet(
props: Props,
- ref: React.Ref<typeof GorhomBottomSheet>,
+ ref: ReactRefSetter<typeof GorhomBottomSheet>,
): React.Node {
const { children, onClosed } = props;
diff --git a/native/chat/chat-thread-list-search.react.js b/native/chat/chat-thread-list-search.react.js
--- a/native/chat/chat-thread-list-search.react.js
+++ b/native/chat/chat-thread-list-search.react.js
@@ -4,6 +4,8 @@
import { TextInput as BaseTextInput } from 'react-native';
import Animated from 'react-native-reanimated';
+import type { ReactRefSetter } from 'lib/types/react-types.js';
+
import type { SearchStatus } from './chat-thread-list.react.js';
import Button from '../components/button.react.js';
import Search from '../components/search.react.js';
@@ -25,7 +27,10 @@
+innerSearchAutoFocus?: boolean,
+innerSearchActive?: boolean,
};
-function ForwardedChatThreadListSearch(props: Props, ref): React.Node {
+function ForwardedChatThreadListSearch(
+ props: Props,
+ ref: ReactRefSetter<React.ElementRef<typeof BaseTextInput>>,
+): React.Node {
const {
searchText,
onChangeText,
diff --git a/native/components/gesture-touchable-opacity.react.js b/native/components/gesture-touchable-opacity.react.js
--- a/native/components/gesture-touchable-opacity.react.js
+++ b/native/components/gesture-touchable-opacity.react.js
@@ -9,6 +9,8 @@
} from 'react-native-gesture-handler';
import Animated, { EasingNode } from 'react-native-reanimated';
+import type { ReactRefSetter } from 'lib/types/react-types.js';
+
import type { AnimatedViewStyle, ViewStyle } from '../types/styles.js';
import {
runTiming,
@@ -58,7 +60,7 @@
};
function ForwardedGestureTouchableOpacity(
props: Props,
- ref: React.Ref<typeof TapGestureHandler>,
+ ref: ReactRefSetter<TapGestureHandler>,
) {
const { onPress: innerOnPress, onLongPress: innerOnLongPress } = props;
const onPress = React.useCallback(() => {
diff --git a/native/components/search.react.js b/native/components/search.react.js
--- a/native/components/search.react.js
+++ b/native/components/search.react.js
@@ -10,6 +10,7 @@
} from 'react-native';
import { isLoggedIn } from 'lib/selectors/user-selectors.js';
+import type { ReactRefSetter } from 'lib/types/react-types.js';
import SWMansionIcon from './swmansion-icon.react.js';
import TextInput from './text-input.react.js';
@@ -25,7 +26,10 @@
+active?: boolean,
};
-function ForwardedSearch(props: Props, ref) {
+function ForwardedSearch(
+ props: Props,
+ ref: ReactRefSetter<React.ElementRef<typeof BaseTextInput>>,
+) {
const { onChangeText, searchText, containerStyle, active, ...rest } = props;
const clearSearch = React.useCallback(() => {
diff --git a/native/components/selectable-text-input.react.ios.js b/native/components/selectable-text-input.react.ios.js
--- a/native/components/selectable-text-input.react.ios.js
+++ b/native/components/selectable-text-input.react.ios.js
@@ -4,6 +4,7 @@
import * as React from 'react';
import type { Selection } from 'lib/shared/mention-utils.js';
+import type { ReactRefSetter } from 'lib/types/react-types.js';
// eslint-disable-next-line import/extensions
import ClearableTextInput from './clearable-text-input.react';
@@ -15,7 +16,7 @@
const SelectableTextInput = React.forwardRef(function BaseSelectableTextInput(
props,
- ref,
+ ref: ReactRefSetter<SelectableTextInputRef>,
): React.Node {
const {
clearableTextInputRef,
diff --git a/native/components/selectable-text-input.react.js b/native/components/selectable-text-input.react.js
--- a/native/components/selectable-text-input.react.js
+++ b/native/components/selectable-text-input.react.js
@@ -2,6 +2,8 @@
import * as React from 'react';
+import type { ReactRefSetter } from 'lib/types/react-types.js';
+
// eslint-disable-next-line import/extensions
import ClearableTextInput from './clearable-text-input.react';
import type {
@@ -12,7 +14,7 @@
const SelectableTextInput = React.forwardRef(function BaseSelectableTextInput(
props,
- ref,
+ ref: ReactRefSetter<SelectableTextInputRef>,
): React.Node {
const {
clearableTextInputRef,
diff --git a/native/components/tag-input.react.js b/native/components/tag-input.react.js
--- a/native/components/tag-input.react.js
+++ b/native/components/tag-input.react.js
@@ -14,6 +14,7 @@
} from 'react-native';
import type { Shape } from 'lib/types/core.js';
+import type { ReactRefSetter } from 'lib/types/react-types.js';
import TextInput from './text-input.react.js';
import { useSelector } from '../redux/redux-utils.js';
@@ -463,7 +464,7 @@
return React.forwardRef<BaseConfig<T>, BaseTagInput<T>>(
function ForwardedTagInput(
props: BaseConfig<T>,
- ref: React.Ref<typeof BaseTagInput>,
+ ref: ReactRefSetter<BaseTagInput<T>>,
) {
const windowWidth = useSelector(state => state.dimensions.width);
const colors = useColors();
diff --git a/native/components/text-input.react.js b/native/components/text-input.react.js
--- a/native/components/text-input.react.js
+++ b/native/components/text-input.react.js
@@ -3,10 +3,15 @@
import * as React from 'react';
import { TextInput } from 'react-native';
+import type { ReactRefSetter } from 'lib/types/react-types.js';
+
import { useKeyboardAppearance } from '../themes/colors.js';
type Props = React.ElementConfig<typeof TextInput>;
-function ForwardedTextInput(props: Props, ref): React.Node {
+function ForwardedTextInput(
+ props: Props,
+ ref: ReactRefSetter<React.ElementRef<typeof TextInput>>,
+): React.Node {
const keyboardAppearance = useKeyboardAppearance();
return (
<TextInput keyboardAppearance={keyboardAppearance} {...props} ref={ref} />

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 6:31 AM (19 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2574308
Default Alt Text
D10000.id33884.diff (6 KB)

Event Timeline