Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32158348
D15030.1765037598.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
10 KB
Referenced Files
None
Subscribers
None
D15030.1765037598.diff
View Options
diff --git a/lib/types/react-types.js b/lib/types/react-types.js
--- a/lib/types/react-types.js
+++ b/lib/types/react-types.js
@@ -1,8 +1,3 @@
// @flow
-// Flow 0.217 introduces React.RefSetter
-export type ReactRefSetter<I> =
- | { current: null | I, ... }
- | ((null | I) => mixed);
-
export type ReactRef<T> = { current: null | T };
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,8 +3,6 @@
import * as React from 'react';
import { TextInput } from 'react-native';
-import type { ReactRefSetter } from 'lib/types/react-types.js';
-
import {
useStyles,
useColors,
@@ -16,7 +14,7 @@
function ForwardedRegistrationTextInput(
props: Props,
- ref: ReactRefSetter<React.ElementRef<typeof TextInput>>,
+ ref: React.RefSetter<React.ElementRef<typeof TextInput>>,
): React.Node {
const {
onFocus,
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,8 +4,6 @@
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 { handleTotalHeight } from './bottom-sheet-constants.js';
import BottomSheetHandle from './bottom-sheet-handle.react.js';
@@ -19,7 +17,7 @@
function ForwardedBottomSheet(
props: Props,
- ref: ReactRefSetter<typeof GorhomBottomSheet>,
+ ref: React.RefSetter<typeof GorhomBottomSheet>,
): React.Node {
const { children, onClosed } = props;
diff --git a/native/chat/chat-tab-bar.react.js b/native/chat/chat-tab-bar.react.js
--- a/native/chat/chat-tab-bar.react.js
+++ b/native/chat/chat-tab-bar.react.js
@@ -12,8 +12,6 @@
import type { MeasureOnSuccessCallback } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
import { TabBarItem } from 'react-native-tab-view';
-import type { ReactRefSetter } from 'lib/types/react-types.js';
-
import {
nuxTip,
NUXTipsContext,
@@ -35,7 +33,7 @@
invariant(tipsContext, 'NUXTipsContext should be defined');
const { registerTipButton } = tipsContext;
- const registerRef: ReactRefSetter<React.ElementRef<typeof View>> =
+ const registerRef: React.RefSetter<React.ElementRef<typeof View>> =
React.useCallback(
element => {
const tipType = ButtonTitleToTip[props.route.name];
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
@@ -10,8 +10,6 @@
type SharedValue,
} 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';
@@ -31,7 +29,7 @@
};
function ForwardedChatThreadListSearch(
props: Props,
- ref: ReactRefSetter<React.ElementRef<typeof BaseTextInput>>,
+ ref: React.RefSetter<React.ElementRef<typeof BaseTextInput>>,
): React.Node {
const {
searchText,
diff --git a/native/chat/chat.react.js b/native/chat/chat.react.js
--- a/native/chat/chat.react.js
+++ b/native/chat/chat.react.js
@@ -32,7 +32,6 @@
import { isLoggedIn } from 'lib/selectors/user-selectors.js';
import { threadSettingsNotificationsCopy } from 'lib/shared/thread-settings-notifications-utils.js';
import { threadIsPending, threadIsSidebar } from 'lib/shared/thread-utils.js';
-import type { ReactRefSetter } from 'lib/types/react-types.js';
import BackgroundChatThreadList from './background-chat-thread-list.react.js';
import ChatHeader from './chat-header.react.js';
@@ -383,7 +382,7 @@
invariant(tipsContext, 'NUXTipsContext should be defined');
const { registerTipButton } = tipsContext;
- const communityDrawerButtonRegisterRef: ReactRefSetter<
+ const communityDrawerButtonRegisterRef: React.RefSetter<
React.ElementRef<typeof View>,
> = React.useCallback(
element => {
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
@@ -18,8 +18,6 @@
useAnimatedStyle,
} from 'react-native-reanimated';
-import type { ReactRefSetter } from 'lib/types/react-types.js';
-
import type { AnimatedViewStyle, ViewStyle } from '../types/styles.js';
import { useSharedValueForBoolean } from '../utils/animation-utils.js';
@@ -48,7 +46,7 @@
};
function ForwardedGestureTouchableOpacity(
props: Props,
- ref: ReactRefSetter<TapGestureHandler>,
+ ref: React.RefSetter<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,7 +10,6 @@
} 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';
@@ -28,7 +27,7 @@
function ForwardedSearch(
props: Props,
- ref: ReactRefSetter<React.ElementRef<typeof BaseTextInput>>,
+ ref: React.RefSetter<React.ElementRef<typeof BaseTextInput>>,
) {
const { onChangeText, searchText, containerStyle, active, ...rest } = props;
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,7 +4,6 @@
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';
@@ -16,7 +15,7 @@
const SelectableTextInput = React.forwardRef(function BaseSelectableTextInput(
props: SelectableTextInputProps,
- ref: ReactRefSetter<SelectableTextInputRef>,
+ ref: React.RefSetter<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,8 +2,6 @@
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 {
@@ -14,7 +12,7 @@
const SelectableTextInput = React.forwardRef(function BaseSelectableTextInput(
props: SelectableTextInputProps,
- ref: ReactRefSetter<SelectableTextInputRef>,
+ ref: React.RefSetter<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
@@ -13,8 +13,6 @@
Platform,
} from 'react-native';
-import type { ReactRefSetter } from 'lib/types/react-types.js';
-
import TextInput from './text-input.react.js';
import { useSelector } from '../redux/redux-utils.js';
import { useColors, type Colors } from '../themes/colors.js';
@@ -460,7 +458,7 @@
return React.forwardRef<BaseConfig<T>, BaseTagInput<T>>(
function ForwardedTagInput(
props: BaseConfig<T>,
- ref: ReactRefSetter<BaseTagInput<T>>,
+ ref: React.RefSetter<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,14 +3,12 @@
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: ReactRefSetter<React.ElementRef<typeof TextInput>>,
+ ref: React.RefSetter<React.ElementRef<typeof TextInput>>,
): React.Node {
const keyboardAppearance = useKeyboardAppearance();
return (
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
@@ -5,7 +5,6 @@
import SWMansionIcon, {
type Icon,
} from 'lib/components/swmansion-icon.react.js';
-import type { ReactRefSetter } from 'lib/types/react-types.js';
import css from './password-input.css';
import Button from '../components/button.react.js';
@@ -15,7 +14,7 @@
function PasswordInput(
props: PasswordInputProps,
- ref: ReactRefSetter<HTMLInputElement>,
+ ref: React.RefSetter<HTMLInputElement>,
): React.Node {
const [htmlInputType, setHtmlInputType] = React.useState<'password' | 'text'>(
'password',
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
@@ -4,7 +4,6 @@
import * as React from 'react';
import SWMansionIcon from 'lib/components/swmansion-icon.react.js';
-import type { ReactRefSetter } from 'lib/types/react-types.js';
import ClearSearchButton from './clear-search-button.react.js';
import css from './search.css';
@@ -19,7 +18,7 @@
function Search(
props: Props,
- ref: ReactRefSetter<HTMLInputElement>,
+ ref: React.RefSetter<HTMLInputElement>,
): React.Node {
const { searchText, onChangeText, placeholder, onClearText, ...rest } = props;
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
@@ -3,8 +3,6 @@
import classNames from 'classnames';
import * as React from 'react';
-import type { ReactRefSetter } from 'lib/types/react-types.js';
-
import css from './input.css';
export type BaseInputProps = {
@@ -26,7 +24,7 @@
function Input(
props: InputProps,
- ref: ReactRefSetter<HTMLInputElement>,
+ ref: React.RefSetter<HTMLInputElement>,
): React.Node {
const {
label: labelProp,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 6, 4:13 PM (22 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5839412
Default Alt Text
D15030.1765037598.diff (10 KB)
Attached To
Mode
D15030: [Flow262][skip-ci] ReactRefSetter -> React.RefSetter
Attached
Detach File
Event Timeline
Log In to Comment