Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ type OnyxValuesMapping = {
[ONYXKEYS.PERSONAL_BANK_ACCOUNT]: OnyxTypes.PersonalBankAccount;
[ONYXKEYS.REIMBURSEMENT_ACCOUNT]: OnyxTypes.ReimbursementAccount;
[ONYXKEYS.REIMBURSEMENT_ACCOUNT_OPTION_PRESSED]: ValueOf<typeof CONST.BANK_ACCOUNT.SETUP_TYPE>;
[ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE]: number;
[ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE]: string | number;
[ONYXKEYS.FREQUENTLY_USED_EMOJIS]: OnyxTypes.FrequentlyUsedEmoji[];
[ONYXKEYS.REIMBURSEMENT_ACCOUNT_WORKSPACE_ID]: string;
[ONYXKEYS.IS_LOADING_PAYMENT_METHODS]: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/components/EmojiPicker/EmojiPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function EmojiPicker({viewportOffsetTop, ref}: EmojiPickerProps) {
/**
* Callback for the emoji picker to add whatever emoji is chosen into the main input
*/
const selectEmoji = (emoji: string, emojiObject: Emoji, preferredSkinTone: number) => {
const selectEmoji = (emoji: string, emojiObject: Emoji) => {
// Prevent fast click / multiple emoji selection;
// The first click will hide the emoji picker by calling the hideEmojiPicker() function
if (!isEmojiPickerVisible) {
Expand All @@ -192,7 +192,7 @@ function EmojiPicker({viewportOffsetTop, ref}: EmojiPickerProps) {

hideEmojiPicker(false);
if (typeof onEmojiSelected.current === 'function') {
onEmojiSelected.current(emoji, emojiObject, preferredSkinTone);
onEmojiSelected.current(emoji, emojiObject);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function EmojiPickerMenu({onEmojiSelected, activeEmoji, ref}: EmojiPickerMenuPro
if (!('name' in item)) {
return;
}
onEmojiSelected(emoji, item, preferredSkinTone);
onEmojiSelected(emoji, item);
})}
emoji={emojiCode ?? ''}
isHighlighted={shouldEmojiBeHighlighted}
Expand Down
4 changes: 2 additions & 2 deletions src/components/EmojiPicker/EmojiPickerMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function EmojiPickerMenu({onEmojiSelected, activeEmoji, ref}: EmojiPickerMenuPro
}
if ('types' in item || 'name' in item) {
const emoji = typeof preferredSkinTone === 'number' && preferredSkinTone !== -1 && item?.types?.at(preferredSkinTone) ? item.types.at(preferredSkinTone) : item.code;
onEmojiSelected(emoji ?? '', item, preferredSkinTone);
onEmojiSelected(emoji ?? '', item);
// On web, avoid this Enter default input action; otherwise, it will add a new line in the subsequently focused composer.
keyBoardEvent.preventDefault();
// On mWeb, avoid propagating this Enter keystroke to Pressable child component; otherwise, it will trigger the onEmojiSelected callback again.
Expand Down Expand Up @@ -282,7 +282,7 @@ function EmojiPickerMenu({onEmojiSelected, activeEmoji, ref}: EmojiPickerMenuPro
if (!('name' in item)) {
return;
}
onEmojiSelected(emoji, item, preferredSkinTone);
onEmojiSelected(emoji, item);
})}
onHoverIn={() => {
setHighlightEmoji(false);
Expand Down
2 changes: 1 addition & 1 deletion src/components/EmojiPicker/EmojiPickerMenu/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {BaseTextInputRef} from '@components/TextInput/BaseTextInput/types';

type EmojiPickerMenuProps = {
/** Function to add the selected emoji to the main compose text input */
onEmojiSelected: (emoji: string, emojiObject: Emoji, preferredSkinTone: number) => void;
onEmojiSelected: (emoji: string, emojiObject: Emoji) => void;

activeEmoji?: string;

Expand Down
6 changes: 3 additions & 3 deletions src/components/Reactions/AddReactionBubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type AddReactionBubbleProps = {
/**
* Called when the user selects an emoji.
*/
onSelectEmoji: (emoji: Emoji, preferredSkinTone: number) => void;
onSelectEmoji: (emoji: Emoji) => void;

/**
* ReportAction for EmojiPicker.
Expand All @@ -63,8 +63,8 @@ function AddReactionBubble({onSelectEmoji, reportAction, onPressOpenPicker, onWi
onModalHide: () => {
setIsEmojiPickerActive?.(false);
},
onEmojiSelected: (emojiCode, emojiObject, preferredSkinTone) => {
onSelectEmoji(emojiObject, preferredSkinTone);
onEmojiSelected: (emojiCode, emojiObject) => {
onSelectEmoji(emojiObject);
},
emojiPopoverAnchor: refParam ?? ref,
anchorOrigin,
Expand Down
15 changes: 4 additions & 11 deletions src/components/Reactions/MiniQuickEmojiReactions.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback, useRef} from 'react';
import React, {useRef} from 'react';
import {View} from 'react-native';
import type {Emoji} from '@assets/emojis/types';
import BaseMiniContextMenuItem from '@components/BaseMiniContextMenuItem';
Expand Down Expand Up @@ -42,19 +42,12 @@ function MiniQuickEmojiReactions({reportAction, reportActionID, onEmojiSelected,
const [preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE] = useOnyx(ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE, {canBeMissing: true});
const [emojiReactions = getEmptyObject<ReportActionReactions>()] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS_REACTIONS}${reportActionID}`, {canBeMissing: true});

const onEmojiSelectedWithReactions = useCallback(
(emoji: Emoji, skinTone: number) => {
onEmojiSelected(emoji, emojiReactions, skinTone);
},
[onEmojiSelected, emojiReactions],
);

const openEmojiPicker = () => {
onPressOpenPicker();
showEmojiPicker({
onModalHide: onEmojiPickerClosed,
onEmojiSelected: (_emojiCode, emojiObject, skinTone) => {
onEmojiSelectedWithReactions(emojiObject, skinTone);
onEmojiSelected: (_emojiCode, emojiObject) => {

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.

❌ PERF-4 (docs)

This inline arrow function creates a new function instance on every render because it closes over emojiReactions, which changes reference frequently. The openEmojiPicker function itself will be recreated on every render, causing unnecessary re-renders when passed as a callback.

Suggested fix: Memoize the callback with useCallback:

const handleEmojiSelected = useCallback(
    (_emojiCode: string, emojiObject: Emoji) => {
        onEmojiSelected(emojiObject, emojiReactions);
    },
    [onEmojiSelected, emojiReactions]
);

const openEmojiPicker = useCallback(() => {
    onPressOpenPicker();
    showEmojiPicker({
        onModalHide: onEmojiPickerClosed,
        onEmojiSelected: handleEmojiSelected,
        emojiPopoverAnchor: ref,
        id: reportAction.reportActionID,
    });
}, [onPressOpenPicker, onEmojiPickerClosed, handleEmojiSelected, reportAction.reportActionID]);

onEmojiSelected(emojiObject, emojiReactions);
},
emojiPopoverAnchor: ref,
id: reportAction.reportActionID,
Expand All @@ -68,7 +61,7 @@ function MiniQuickEmojiReactions({reportAction, reportActionID, onEmojiSelected,
key={emoji.name}
isDelayButtonStateComplete={false}
tooltipText={`:${getLocalizedEmojiName(emoji.name, preferredLocale)}:`}
onPress={callFunctionIfActionIsAllowed(() => onEmojiSelected(emoji, emojiReactions, preferredSkinTone))}
onPress={callFunctionIfActionIsAllowed(() => onEmojiSelected(emoji, emojiReactions))}
>
<Text
style={[styles.miniQuickEmojiReactionText, styles.userSelectNone]}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback} from 'react';
import React from 'react';
import {View} from 'react-native';
import type {Emoji} from '@assets/emojis/types';
import AddReactionBubble from '@components/Reactions/AddReactionBubble';
Expand Down Expand Up @@ -28,13 +28,6 @@ function BaseQuickEmojiReactions({
const [preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE] = useOnyx(ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE, {canBeMissing: true});
const [emojiReactions = getEmptyObject<ReportActionReactions>()] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS_REACTIONS}${reportActionID}`, {canBeMissing: true});

const onEmojiSelectedWithReactions = useCallback(
(emoji: Emoji, skinTone: number) => {
onEmojiSelected(emoji, emojiReactions, skinTone);
},
[onEmojiSelected, emojiReactions],
);

return (
<View style={styles.quickReactionsContainer}>
{CONST.QUICK_REACTIONS.map((emoji: Emoji) => (
Expand All @@ -46,7 +39,7 @@ function BaseQuickEmojiReactions({
<EmojiReactionBubble
emojiCodes={[getPreferredEmojiCode(emoji, preferredSkinTone)]}
isContextMenu
onPress={callFunctionIfActionIsAllowed(() => onEmojiSelected(emoji, emojiReactions, preferredSkinTone))}
onPress={callFunctionIfActionIsAllowed(() => onEmojiSelected(emoji, emojiReactions))}
/>
</View>
</Tooltip>
Expand All @@ -55,7 +48,7 @@ function BaseQuickEmojiReactions({
isContextMenu
onPressOpenPicker={onPressOpenPicker}
onWillShowPicker={onWillShowPicker}
onSelectEmoji={onEmojiSelectedWithReactions}
onSelectEmoji={(emoji) => onEmojiSelected(emoji, emojiReactions)}

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.

❌ PERF-4 (docs)

This inline arrow function creates a new function instance on every render because emojiReactions changes reference. When emojiReactions updates, this creates a new function, causing AddReactionBubble to re-render unnecessarily.

Suggested fix: Memoize the callback with useCallback:

const handleSelectEmoji = useCallback(
    (emoji: Emoji) => {
        onEmojiSelected(emoji, emojiReactions);
    },
    [onEmojiSelected, emojiReactions]
);

// Then use it in the JSX:
<AddReactionBubble
    ...
    onSelectEmoji={handleSelectEmoji}
    ...
/>

reportAction={reportAction}
setIsEmojiPickerActive={setIsEmojiPickerActive}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Reactions/QuickEmojiReactions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type CloseContextMenuCallback = () => void;

type BaseReactionsProps = {
/** Callback to fire when an emoji is selected. */
onEmojiSelected: (emoji: Emoji, emojiReactions: OnyxEntry<ReportActionReactions>, preferredSkinTone: number) => void;
onEmojiSelected: (emoji: Emoji, emojiReactions: OnyxEntry<ReportActionReactions>) => void;

/**
* Will be called when the emoji picker is about to show.
Expand Down
7 changes: 2 additions & 5 deletions src/components/Reactions/ReportActionItemEmojiReactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import OfflineWithFeedback from '@components/OfflineWithFeedback';
import Tooltip from '@components/Tooltip/PopoverAnchorTooltip';
import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalDetails';
import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentUserPersonalDetails';
import useOnyx from '@hooks/useOnyx';
import useThemeStyles from '@hooks/useThemeStyles';
import {getEmojiReactionDetails, getLocalizedEmojiName} from '@libs/EmojiUtils';
import {ReactionListContext} from '@pages/home/ReportScreenContext';
import type {ReactionListAnchor, ReactionListEvent} from '@pages/home/ReportScreenContext';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {Locale, ReportAction, ReportActionReactions} from '@src/types/onyx';
import type {PendingAction} from '@src/types/onyx/OnyxCommon';
import AddReactionBubble from './AddReactionBubble';
Expand All @@ -35,7 +33,7 @@ type ReportActionItemEmojiReactionsProps = WithCurrentUserPersonalDetailsProps &
* This can also be an emoji the user already reacted with,
* hence this function asks to toggle the reaction by emoji.
*/
toggleReaction: (emoji: Emoji, preferredSkinTone: number, ignoreSkinToneOnCompare?: boolean) => void;
toggleReaction: (emoji: Emoji, ignoreSkinToneOnCompare?: boolean) => void;

/** We disable reacting with emojis on report actions that have errors */
shouldBlockReactions?: boolean;
Expand Down Expand Up @@ -89,7 +87,6 @@ function ReportActionItemEmojiReactions({
const styles = useThemeStyles();
const reactionListRef = useContext(ReactionListContext);
const popoverReactionListAnchors = useRef<PopoverReactionListAnchors>({});
const [preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE] = useOnyx(ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE, {canBeMissing: true});

const reportActionID = reportAction.reportActionID;

Expand All @@ -107,7 +104,7 @@ function ReportActionItemEmojiReactions({
}

const onPress = () => {
toggleReaction(emoji, preferredSkinTone, true);
toggleReaction(emoji, true);
};

const onReactionListOpen = (event: ReactionListEvent) => {
Expand Down
3 changes: 1 addition & 2 deletions src/hooks/usePreferredEmojiSkinTone.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import {useCallback} from 'react';
import {updatePreferredSkinTone as updatePreferredSkinToneAction} from '@userActions/User';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import useOnyx from './useOnyx';

export default function usePreferredEmojiSkinTone() {
const [preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE] = useOnyx(ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE, {canBeMissing: true});
const [preferredSkinTone] = useOnyx(ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE, {canBeMissing: true});

const updatePreferredSkinTone = useCallback(
(skinTone: number) => {
Expand Down
12 changes: 12 additions & 0 deletions src/libs/EmojiUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,17 @@ function suggestEmojis(text: string, locale: Locale = CONST.LOCALES.DEFAULT, lim
return lodashSortBy(matching, (emoji) => sortByName(emoji, emojiData));
}

/**
* Retrieve preferredSkinTone as Number to prevent legacy 'default' String value
*/
const getPreferredSkinToneIndex = (value: OnyxEntry<string | number>): number => {
if (value !== null && Number.isInteger(Number(value))) {
return Number(value);
}

return CONST.EMOJI_DEFAULT_SKIN_TONE;
};

/**
* Given an emoji object it returns the correct emoji code
* based on the users preferred skin tone.
Expand Down Expand Up @@ -675,6 +686,7 @@ export {
replaceEmojis,
suggestEmojis,
getEmojiCodeWithSkinColor,
getPreferredSkinToneIndex,
getPreferredEmojiCode,
getUniqueEmojiCodes,
getEmojiReactionDetails,
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/EmojiPickerAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type EmojiPickerRef = {
resetEmojiPopoverAnchor: () => void;
};

type OnEmojiSelected = (emojiCode: string, emojiObject: Emoji, preferredSkinTone: number) => void;
type OnEmojiSelected = (emojiCode: string, emojiObject: Emoji) => void;

const emojiPickerRef = React.createRef<EmojiPickerRef>();

Expand Down
16 changes: 12 additions & 4 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,14 @@ Onyx.connect({
callback: (value) => (conciergeReportID = value),
});

let preferredSkinTone: number = CONST.EMOJI_DEFAULT_SKIN_TONE;
Onyx.connect({
key: ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE,
callback: (value) => {
preferredSkinTone = EmojiUtils.getPreferredSkinToneIndex(value);
},
});

// map of reportID to all reportActions for that report
const allReportActions: OnyxCollection<ReportActions> = {};

Expand Down Expand Up @@ -3379,7 +3387,7 @@ function clearIOUError(reportID: string | undefined) {
* Adds a reaction to the report action.
* Uses the NEW FORMAT for "emojiReactions"
*/
function addEmojiReaction(reportID: string, reportActionID: string, emoji: Emoji, skinTone: number) {
function addEmojiReaction(reportID: string, reportActionID: string, emoji: Emoji, skinTone: string | number = preferredSkinTone) {
const createdAt = timezoneFormat(toZonedTime(new Date(), 'UTC'), CONST.DATE.FNS_DB_FORMAT_STRING);
const optimisticData: OnyxUpdate[] = [
{
Expand All @@ -3392,7 +3400,7 @@ function addEmojiReaction(reportID: string, reportActionID: string, emoji: Emoji
users: {
[currentUserAccountID]: {
skinTones: {
[skinTone]: createdAt,
[skinTone ?? CONST.EMOJI_DEFAULT_SKIN_TONE]: createdAt,
},
},
},
Expand Down Expand Up @@ -3473,7 +3481,7 @@ function toggleEmojiReaction(
reportAction: ReportAction,
reactionObject: Emoji,
existingReactions: OnyxEntry<ReportActionReactions>,
paramSkinTone: number,
paramSkinTone: number = preferredSkinTone,
ignoreSkinToneOnCompare = false,
) {
const originalReportID = getOriginalReportID(reportID, reportAction);
Expand All @@ -3494,7 +3502,7 @@ function toggleEmojiReaction(
const existingReactionObject = existingReactions?.[emoji.name];

// Only use skin tone if emoji supports it
const skinTone = emoji.types === undefined ? CONST.EMOJI_DEFAULT_SKIN_TONE : paramSkinTone;
const skinTone = emoji.types === undefined ? -1 : paramSkinTone;

if (existingReactionObject && EmojiUtils.hasAccountIDEmojiReacted(currentUserAccountID, existingReactionObject.users, ignoreSkinToneOnCompare ? undefined : skinTone)) {
removeEmojiReaction(originalReportID, reportAction.reportActionID, emoji);
Expand Down
4 changes: 2 additions & 2 deletions src/pages/home/report/ContextMenu/ContextMenuActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ const ContextMenuActions: ContextMenuAction[] = [
}
};

const toggleEmojiAndCloseMenu = (emoji: Emoji, existingReactions: OnyxEntry<ReportActionReactions>, preferredSkinTone: number) => {
toggleEmojiReaction(reportID, reportAction, emoji, existingReactions, preferredSkinTone);
const toggleEmojiAndCloseMenu = (emoji: Emoji, existingReactions: OnyxEntry<ReportActionReactions>) => {
toggleEmojiReaction(reportID, reportAction, emoji, existingReactions);
closeContextMenu();
setIsEmojiPickerActive?.(false);
};
Expand Down
10 changes: 5 additions & 5 deletions src/pages/home/report/PureReportActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ type PureReportActionItemProps = {
reportAction: OnyxTypes.ReportAction,
reactionObject: Emoji,
existingReactions: OnyxEntry<OnyxTypes.ReportActionReactions>,
paramSkinTone: number,
paramSkinTone: number | undefined,
ignoreSkinToneOnCompare: boolean | undefined,
) => void;

Expand Down Expand Up @@ -711,8 +711,8 @@ function PureReportActionItem({
);

const toggleReaction = useCallback(
(emoji: Emoji, preferredSkinTone: number, ignoreSkinToneOnCompare?: boolean) => {
toggleEmojiReaction(reportID, action, emoji, emojiReactions, preferredSkinTone, ignoreSkinToneOnCompare);
(emoji: Emoji, ignoreSkinToneOnCompare?: boolean) => {
toggleEmojiReaction(reportID, action, emoji, emojiReactions, undefined, ignoreSkinToneOnCompare);
},
[reportID, action, emojiReactions, toggleEmojiReaction],
);
Expand Down Expand Up @@ -1535,7 +1535,7 @@ function PureReportActionItem({
reportAction={action}
emojiReactions={isOnSearch ? {} : emojiReactions}
shouldBlockReactions={hasErrors}
toggleReaction={(emoji, preferredSkinTone, ignoreSkinToneOnCompare) => {
toggleReaction={(emoji, ignoreSkinToneOnCompare) => {
if (isAnonymousUser()) {
hideContextMenu(false);

Expand All @@ -1544,7 +1544,7 @@ function PureReportActionItem({
signOutAndRedirectToSignIn();
});
} else {
toggleReaction(emoji, preferredSkinTone, ignoreSkinToneOnCompare);
toggleReaction(emoji, ignoreSkinToneOnCompare);
}
}}
setIsEmojiPickerActive={setIsEmojiPickerActive}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import canFocusInputOnScreenFocus from '@libs/canFocusInputOnScreenFocus';
import {forceClearInput} from '@libs/ComponentUtils';
import {canSkipTriggerHotkeys, findCommonSuffixLength, insertText, insertWhiteSpaceAtIndex} from '@libs/ComposerUtils';
import convertToLTRForComposer from '@libs/convertToLTRForComposer';
import {containsOnlyEmojis, extractEmojis, getAddedEmojis, replaceAndExtractEmojis} from '@libs/EmojiUtils';
import {containsOnlyEmojis, extractEmojis, getAddedEmojis, getPreferredSkinToneIndex, replaceAndExtractEmojis} from '@libs/EmojiUtils';
import focusComposerWithDelay from '@libs/focusComposerWithDelay';
import getPlatform from '@libs/getPlatform';
import {addKeyDownPressListener, removeKeyDownPressListener} from '@libs/KeyboardShortcut/KeyDownPressListener';
Expand Down Expand Up @@ -249,7 +249,7 @@ function ComposerWithSuggestions({
const commentRef = useRef(value);

const [modal] = useOnyx(ONYXKEYS.MODAL, {canBeMissing: true});
const [preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE] = useOnyx(ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE, {canBeMissing: true});
const [preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE] = useOnyx(ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE, {selector: getPreferredSkinToneIndex, canBeMissing: true});
const [editFocused] = useOnyx(ONYXKEYS.INPUT_FOCUSED, {canBeMissing: true});

const lastTextRef = useRef(value);
Expand Down
Loading