Page MenuHomePhorge

D15046.1765070706.diff
No OneTemporary

Size
14 KB
Referenced Files
None
Subscribers
None

D15046.1765070706.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
@@ -86,10 +86,15 @@
},
};
-const RegistrationTextInput: React.ComponentType<Props> = React.forwardRef<
- Props,
- React.ElementRef<typeof TextInput>,
->(ForwardedRegistrationTextInput);
+type RegistrationTextInputComponentType = component(
+ ref: React.RefSetter<React.ElementRef<typeof TextInput>>,
+ ...Props
+);
+
+const RegistrationTextInput: RegistrationTextInputComponentType =
+ React.forwardRef<Props, React.ElementRef<typeof TextInput>>(
+ ForwardedRegistrationTextInput,
+ );
RegistrationTextInput.displayName = 'RegistrationTextInput';
const MemoizedRegistrationTextInput: typeof RegistrationTextInput = React.memo<
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
@@ -9,6 +9,7 @@
import BottomSheetHandle from './bottom-sheet-handle.react.js';
import { BottomSheetContext } from './bottom-sheet-provider.react.js';
import { useStyles } from '../themes/colors.js';
+import type { BottomSheetRef } from '../types/bottom-sheet.js';
type Props = {
+children: React.Node,
@@ -63,7 +64,12 @@
},
};
-const BottomSheet: React.ComponentType<Props> = React.forwardRef<
+type BottomSheetComponentType = component(
+ ref: React.RefSetter<?BottomSheetRef>,
+ ...Props
+);
+
+const BottomSheet: BottomSheetComponentType = React.forwardRef<
Props,
React.ElementRef<typeof GorhomBottomSheet>,
>(ForwardedBottomSheet);
diff --git a/native/chat/chat-input-bar.react.js b/native/chat/chat-input-bar.react.js
--- a/native/chat/chat-input-bar.react.js
+++ b/native/chat/chat-input-bar.react.js
@@ -79,7 +79,10 @@
import Button from '../components/button.react.js';
// eslint-disable-next-line import/extensions
import ClearableTextInput from '../components/clearable-text-input.react';
-import type { SyncedSelectionData } from '../components/selectable-text-input.js';
+import type {
+ SyncedSelectionData,
+ SelectableTextInputRef,
+} from '../components/selectable-text-input.js';
// eslint-disable-next-line import/extensions
import SelectableTextInput from '../components/selectable-text-input.react';
import SingleLine from '../components/single-line.react.js';
@@ -500,8 +503,7 @@
const textInputRef = React.useRef<?React.ElementRef<typeof TextInput>>();
const clearableTextInputRef = React.useRef<?ClearableTextInput>();
- const selectableTextInputRef =
- React.useRef<?React.ElementRef<typeof SelectableTextInput>>();
+ const selectableTextInputRef = React.useRef<?SelectableTextInputRef>();
const setTextInputRef = React.useCallback(
(ref: ?React.ElementRef<typeof TextInput>) => {
textInputRef.current = ref;
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
@@ -154,10 +154,15 @@
},
};
-const ChatThreadListSearch: React.ComponentType<Props> = React.forwardRef<
- Props,
- React.ElementRef<typeof BaseTextInput>,
->(ForwardedChatThreadListSearch);
+type ChatThreadListSearchComponentType = component(
+ ref: React.RefSetter<React.ElementRef<typeof BaseTextInput>>,
+ ...Props
+);
+
+const ChatThreadListSearch: ChatThreadListSearchComponentType =
+ React.forwardRef<Props, React.ElementRef<typeof BaseTextInput>>(
+ ForwardedChatThreadListSearch,
+ );
ChatThreadListSearch.displayName = 'ChatThreadListSearch';
export default ChatThreadListSearch;
diff --git a/native/components/directory-prompt-bottom-sheet.react.js b/native/components/directory-prompt-bottom-sheet.react.js
--- a/native/components/directory-prompt-bottom-sheet.react.js
+++ b/native/components/directory-prompt-bottom-sheet.react.js
@@ -18,6 +18,7 @@
type NavigationRoute,
NUXTipOverlayBackdropRouteName,
} from '../navigation/route-names.js';
+import type { BottomSheetRef } from '../types/bottom-sheet.js';
export type DirectoryPromptBottomSheetParams = {
+communities: $ReadOnlyArray<ClientCommunityInfoWithCommunityName>,
@@ -39,7 +40,7 @@
const { goBack, navigate } = navigation;
const { communities } = route.params;
- const bottomSheetRef = React.useRef(null);
+ const bottomSheetRef = React.useRef<?BottomSheetRef>(null);
const bottomSheetContext = React.useContext(BottomSheetContext);
invariant(bottomSheetContext, 'bottomSheetContext should be set');
diff --git a/native/components/full-screen-view-modal.react.js b/native/components/full-screen-view-modal.react.js
--- a/native/components/full-screen-view-modal.react.js
+++ b/native/components/full-screen-view-modal.react.js
@@ -44,7 +44,6 @@
import type { NavigationRoute } from '../navigation/route-names.js';
import { useSelector } from '../redux/redux-utils.js';
import { derivedDimensionsInfoSelector } from '../selectors/dimensions-selectors.js';
-import type { NativeMethods } from '../types/react-native.js';
import type { UserProfileBottomSheetNavigationProp } from '../user-profile/user-profile-bottom-sheet-navigator.react.js';
import { clamp } from '../utils/animation-utils.js';
@@ -55,10 +54,6 @@
const decayConfig = { deceleration: 0.99 };
-type TouchableOpacityInstance = React.ComponentType<
- React.ElementConfig<typeof TouchableOpacity>,
->;
-
type ButtonDimensions = {
+x: number,
+y: number,
@@ -128,8 +123,7 @@
[actionLinksEnabled],
);
- const closeButtonRef =
- React.useRef<?React.ElementRef<TouchableOpacityInstance>>();
+ const closeButtonRef = React.useRef<?React.ElementRef<typeof View>>();
const mediaIconsRef = React.useRef<?React.ElementRef<typeof View>>();
const closeButtonDimensions = useSharedValue({
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
@@ -102,10 +102,14 @@
);
}
-const Search: React.ComponentType<Props> = React.forwardRef<
- Props,
- React.ElementRef<typeof BaseTextInput>,
->(ForwardedSearch);
+type SearchComponentType = component(
+ ref: React.RefSetter<React.ElementRef<typeof BaseTextInput>>,
+ ...Props
+);
+
+const Search = React.forwardRef<Props, React.ElementRef<typeof BaseTextInput>>(
+ ForwardedSearch,
+);
Search.displayName = 'Search';
const unboundStyles = {
@@ -138,7 +142,7 @@
},
};
-const MemoizedSearch: typeof Search = React.memo<
+const MemoizedSearch: SearchComponentType = React.memo<
Props,
React.ElementRef<typeof BaseTextInput>,
>(Search);
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
@@ -131,7 +131,12 @@
);
});
-const MemoizedSelectableTextInput: React.ComponentType<SelectableTextInputProps> =
+type MemoizedSelectableTextInputComponent = component(
+ ref: React.RefSetter<SelectableTextInputRef>,
+ ...SelectableTextInputProps
+);
+
+const MemoizedSelectableTextInput: MemoizedSelectableTextInputComponent =
React.memo<SelectableTextInputProps, SelectableTextInputRef>(
SelectableTextInput,
);
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
@@ -76,7 +76,12 @@
);
});
-const MemoizedSelectableTextInput: React.ComponentType<SelectableTextInputProps> =
+type MemoizedSelectableTextInputComponent = component(
+ ref: React.RefSetter<SelectableTextInputRef>,
+ ...SelectableTextInputProps
+);
+
+const MemoizedSelectableTextInput: MemoizedSelectableTextInputComponent =
React.memo<SelectableTextInputProps, SelectableTextInputRef>(
SelectableTextInput,
);
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
@@ -459,7 +459,12 @@
typeof BaseTagInput.defaultProps,
>;
-function createTagInput<T>(): React.ComponentType<BaseConfig<T>> {
+type TagInputComponentType<T> = component(
+ ref: React.RefSetter<BaseTagInput<T>>,
+ ...BaseConfig<T>
+);
+
+function createTagInput<T>(): TagInputComponentType<T> {
return React.forwardRef<BaseConfig<T>, BaseTagInput<T>>(
function ForwardedTagInput(
props: BaseConfig<T>,
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
@@ -16,7 +16,12 @@
);
}
-const WrappedTextInput: React.ComponentType<Props> = React.forwardRef<
+type WrappedTextInputComponentType = component(
+ ref: React.RefSetter<React.ElementRef<typeof TextInput>>,
+ ...Props
+);
+
+const WrappedTextInput: WrappedTextInputComponentType = React.forwardRef<
Props,
React.ElementRef<typeof TextInput>,
>(ForwardedTextInput);
diff --git a/native/media/camera-modal.react.js b/native/media/camera-modal.react.js
--- a/native/media/camera-modal.react.js
+++ b/native/media/camera-modal.react.js
@@ -94,10 +94,6 @@
} catch (e) {}
}
-type TouchableOpacityInstance = React.ComponentType<
- React.ElementConfig<typeof TouchableOpacity>,
->;
-
type Dimensions = {
+x: number,
+y: number,
@@ -440,8 +436,7 @@
setPendingPhotoCapture();
}, []);
- const closeButtonRef =
- React.useRef<?React.ElementRef<TouchableOpacityInstance>>();
+ const closeButtonRef = React.useRef<?React.ElementRef<typeof View>>();
const closeButtonDimensions = useSharedValue({
x: -1,
y: -1,
@@ -449,8 +444,7 @@
height: 0,
});
- const photoButtonRef =
- React.useRef<?React.ElementRef<TouchableOpacityInstance>>();
+ const photoButtonRef = React.useRef<?React.ElementRef<typeof View>>();
const photoButtonDimensions = useSharedValue({
x: -1,
y: -1,
@@ -459,7 +453,7 @@
});
const switchCameraButtonRef =
- React.useRef<?React.ElementRef<TouchableOpacityInstance>>();
+ React.useRef<?React.ElementRef<typeof View>>();
const switchCameraButtonDimensions = useSharedValue({
x: -1,
y: -1,
@@ -467,8 +461,7 @@
height: 0,
});
- const flashButtonRef =
- React.useRef<?React.ElementRef<TouchableOpacityInstance>>();
+ const flashButtonRef = React.useRef<?React.ElementRef<typeof View>>();
const flashButtonDimensions = useSharedValue({
x: -1,
y: -1,
diff --git a/native/media/video-playback-modal.react.js b/native/media/video-playback-modal.react.js
--- a/native/media/video-playback-modal.react.js
+++ b/native/media/video-playback-modal.react.js
@@ -40,11 +40,6 @@
VerticalBounds,
LayoutCoordinates,
} from '../types/layout-types.js';
-import type { NativeMethods } from '../types/react-native.js';
-
-type TouchableOpacityInstance = React.ComponentType<
- React.ElementConfig<typeof TouchableOpacity>,
->;
type VideoRef = {
+seek: number => mixed,
@@ -134,8 +129,7 @@
const closeButtonY = useSharedValue(-1);
const closeButtonWidth = useSharedValue(-1);
const closeButtonHeight = useSharedValue(-1);
- const closeButtonRef =
- React.useRef<?React.ElementRef<TouchableOpacityInstance>>();
+ const closeButtonRef = React.useRef<?React.ElementRef<typeof View>>();
const closeButton = closeButtonRef.current;
const onCloseButtonLayoutCalledRef = React.useRef(false);
const onCloseButtonLayout = React.useCallback(() => {
diff --git a/web/account/password-input.react.js b/web/account/password-input.react.js
--- a/web/account/password-input.react.js
+++ b/web/account/password-input.react.js
@@ -41,8 +41,12 @@
</div>
);
}
+type ForwardedPasswordInputComponentType = component(
+ ref: React.RefSetter<HTMLInputElement>,
+ ...PasswordInputProps
+);
-const ForwardedPasswordInput: React.ComponentType<PasswordInputProps> =
+const ForwardedPasswordInput: ForwardedPasswordInputComponentType =
React.forwardRef<PasswordInputProps, HTMLInputElement>(PasswordInput);
export default ForwardedPasswordInput;
diff --git a/web/components/search.react.js b/web/components/search.react.js
--- a/web/components/search.react.js
+++ b/web/components/search.react.js
@@ -58,7 +58,12 @@
);
}
-const ForwardedSearch: React.ComponentType<Props> = React.forwardRef<
+type ForwardedSearchComponentType = component(
+ ref: React.RefSetter<HTMLInputElement>,
+ ...Props
+);
+
+const ForwardedSearch: ForwardedSearchComponentType = React.forwardRef<
Props,
HTMLInputElement,
>(Search);
diff --git a/web/media/loadable-video.react.js b/web/media/loadable-video.react.js
--- a/web/media/loadable-video.react.js
+++ b/web/media/loadable-video.react.js
@@ -23,7 +23,10 @@
+multimediaClassName?: string,
};
-function LoadableVideo(props: Props, videoRef: React.Ref<'video'>): React.Node {
+function LoadableVideo(
+ props: Props,
+ ref: React.RefSetter<HTMLVideoElement>,
+): React.Node {
const {
uri,
thumbHashDataURL,
@@ -90,14 +93,19 @@
poster={poster}
className={multimediaClassName}
style={elementStyle}
- ref={videoRef}
+ ref={ref}
>
{videoSource}
</video>
);
}
-const MemoizedLoadableVideo: React.ComponentType<Props> = React.memo<
+type MemoizedLoadableVideoComponentType = component(
+ ref: React.RefSetter<HTMLVideoElement>,
+ ...Props
+);
+
+const MemoizedLoadableVideo: MemoizedLoadableVideoComponentType = React.memo<
Props,
HTMLVideoElement,
>(React.forwardRef<Props, HTMLVideoElement>(LoadableVideo));
diff --git a/web/modals/input.react.js b/web/modals/input.react.js
--- a/web/modals/input.react.js
+++ b/web/modals/input.react.js
@@ -59,7 +59,12 @@
);
}
-const ForwardedInput: React.ComponentType<InputProps> = React.forwardRef<
+type ForwardedInputComponentType = component(
+ ref: React.RefSetter<HTMLInputElement>,
+ ...InputProps
+);
+
+const ForwardedInput: ForwardedInputComponentType = React.forwardRef<
InputProps,
HTMLInputElement,
>(Input);

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 7, 1:25 AM (11 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5841949
Default Alt Text
D15046.1765070706.diff (14 KB)

Event Timeline