Respect "rules of hooks" in <SmartCustomizingPreferredReactionsModal>
This commit is contained in:
@@ -25,11 +25,6 @@ export function SmartCustomizingPreferredReactionsModal(): JSX.Element {
|
||||
StateType,
|
||||
ReturnType<typeof getCustomizeModalState>
|
||||
>(state => getCustomizeModalState(state));
|
||||
if (!customizeModalState) {
|
||||
throw new Error(
|
||||
'<SmartCustomizingPreferredReactionsModal> requires a modal'
|
||||
);
|
||||
}
|
||||
|
||||
const recentEmojis = useRecentEmojis();
|
||||
|
||||
@@ -37,6 +32,12 @@ export function SmartCustomizingPreferredReactionsModal(): JSX.Element {
|
||||
getEmojiSkinTone(state)
|
||||
);
|
||||
|
||||
if (!customizeModalState) {
|
||||
throw new Error(
|
||||
'<SmartCustomizingPreferredReactionsModal> requires a modal'
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<CustomizingPreferredReactionsModal
|
||||
i18n={i18n}
|
||||
|
Reference in New Issue
Block a user