From 7d890973d568016d25fc545e69a6583380b896d0 Mon Sep 17 00:00:00 2001 From: William Grant Date: Wed, 8 May 2024 16:45:29 +1000 Subject: [PATCH] fix: usemount imports have to be specific otherwise we can get start errors due to an invalid import by react-use --- ts/components/SessionFocusTrap.tsx | 2 +- ts/components/dialog/OnionStatusPathDialog.tsx | 2 +- ts/components/registration/SessionRegistrationView.tsx | 2 +- ts/components/registration/stages/CreateAccount.tsx | 2 +- ts/components/registration/stages/Start.tsx | 2 +- ts/types/ReduxTypes.d.ts | 2 ++ 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ts/components/SessionFocusTrap.tsx b/ts/components/SessionFocusTrap.tsx index bec1f9471..c6e34e36c 100644 --- a/ts/components/SessionFocusTrap.tsx +++ b/ts/components/SessionFocusTrap.tsx @@ -1,6 +1,6 @@ import FocusTrap from 'focus-trap-react'; import { ReactNode, useState } from 'react'; -import { useMount } from 'react-use'; +import useMount from 'react-use/lib/useMount'; /** * Focus trap which activates on mount. diff --git a/ts/components/dialog/OnionStatusPathDialog.tsx b/ts/components/dialog/OnionStatusPathDialog.tsx index dc9b25b56..c44183776 100644 --- a/ts/components/dialog/OnionStatusPathDialog.tsx +++ b/ts/components/dialog/OnionStatusPathDialog.tsx @@ -7,7 +7,7 @@ import styled from 'styled-components'; import { isEmpty, isTypedArray } from 'lodash'; import { CityResponse, Reader } from 'maxmind'; -import { useMount } from 'react-use'; +import useMount from 'react-use/lib/useMount'; import { Snode } from '../../data/data'; import { onionPathModal } from '../../state/ducks/modalDialog'; import { diff --git a/ts/components/registration/SessionRegistrationView.tsx b/ts/components/registration/SessionRegistrationView.tsx index cea12f50c..ee071014e 100644 --- a/ts/components/registration/SessionRegistrationView.tsx +++ b/ts/components/registration/SessionRegistrationView.tsx @@ -1,7 +1,7 @@ import { Provider } from 'react-redux'; import styled from 'styled-components'; -import { useMount } from 'react-use'; +import useMount from 'react-use/lib/useMount'; import { onboardingStore } from '../../state/onboarding/store'; import { SessionTheme } from '../../themes/SessionTheme'; import { setSignInByLinking } from '../../util/storage'; diff --git a/ts/components/registration/stages/CreateAccount.tsx b/ts/components/registration/stages/CreateAccount.tsx index 2b9bc6992..67b1f4aea 100644 --- a/ts/components/registration/stages/CreateAccount.tsx +++ b/ts/components/registration/stages/CreateAccount.tsx @@ -1,6 +1,6 @@ import { isEmpty } from 'lodash'; import { useDispatch } from 'react-redux'; -import { useMount } from 'react-use'; +import useMount from 'react-use/lib/useMount'; import { SettingsKey } from '../../../data/settings-key'; import { mnDecode } from '../../../session/crypto/mnemonic'; import { StringUtils } from '../../../session/utils'; diff --git a/ts/components/registration/stages/Start.tsx b/ts/components/registration/stages/Start.tsx index b42c206e4..f7007539f 100644 --- a/ts/components/registration/stages/Start.tsx +++ b/ts/components/registration/stages/Start.tsx @@ -1,5 +1,5 @@ import { useDispatch } from 'react-redux'; -import { useMount } from 'react-use'; +import useMount from 'react-use/lib/useMount'; import { AccountCreation, AccountRestoration, diff --git a/ts/types/ReduxTypes.d.ts b/ts/types/ReduxTypes.d.ts index e00b2b394..327e4916a 100644 --- a/ts/types/ReduxTypes.d.ts +++ b/ts/types/ReduxTypes.d.ts @@ -1,6 +1,8 @@ /** * Note: The types defined in this file have to be self contained. * We must not import anything in this file, especially not something relying on the window object (even indirectly, through an import chain). + * + * e.g. import type { YourTypeHere } from 'path/to/ReduxTypes'; */ export type SessionSettingCategory =