Skip to content

Commit 1656340

Browse files
committed
refactor: remove unused MobX observer and clean up imports
- Removed the MobX observer from CreateInvoiceFrom and TextWithSkeleton components to simplify the code and improve readability. - Deleted the createImmediateReaction utility function as it was no longer in use, streamlining the MobX library. - Updated the index file to reflect the removal of the createImmediateReaction export, ensuring a cleaner module structure. These changes collectively enhance code clarity and maintainability by eliminating unnecessary dependencies and simplifying component definitions.
1 parent d50fe19 commit 1656340

File tree

4 files changed

+3
-13
lines changed

4 files changed

+3
-13
lines changed

src/features/invoices/ui/CreateInvoiceFrom.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import {
2828
TokenCurrencyAmount
2929
} from 'src/shared';
3030
import { useIMask } from 'react-imask';
31-
import { observer } from 'mobx-react-lite';
3231
import { CRYPTO_CURRENCY_DECIMALS } from 'src/shared/lib/currency/CRYPTO_CURRENCY';
3332

3433
interface InternalForm {
@@ -53,7 +52,7 @@ export const CreateInvoiceFrom: FC<
5352
defaultValues?: Partial<InvoiceForm>;
5453
disableDefaultFocus?: boolean;
5554
}
56-
> = observer(({ onSubmit, defaultValues, disableDefaultFocus, ...rest }) => {
55+
> = ({ onSubmit, defaultValues, disableDefaultFocus, ...rest }) => {
5756
const { amount: defaultAmount, ...restDefaultValues } = defaultValues || {};
5857
const context = useFormContext<InternalForm>();
5958
let { handleSubmit, register, formState, setFocus } = useForm<InternalForm>({
@@ -200,4 +199,4 @@ export const CreateInvoiceFrom: FC<
200199
</FormControl>
201200
</chakra.form>
202201
);
203-
});
202+
};

src/shared/lib/mobx/create-immediate-reaction.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/shared/lib/mobx/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
export { createReaction } from './create-reaction';
2-
export { createImmediateReaction } from './create-immediate-reaction';
32
export { Loadable } from './loadable';
43
export { deserializeState, serializeState } from './serialize';

src/shared/ui/typography/TextWithSkeleton.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { FC, PropsWithChildren } from 'react';
22
import { Skeleton, Text, TextProps, useTheme } from '@chakra-ui/react';
33
import { subtractPixels } from 'src/shared';
4-
import { observer } from 'mobx-react-lite';
54

65
const TextWithSkeleton: FC<
76
PropsWithChildren<
@@ -34,4 +33,4 @@ const TextWithSkeleton: FC<
3433
return <Text {...rest}>{children}</Text>;
3534
};
3635

37-
export default observer(TextWithSkeleton);
36+
export default TextWithSkeleton;

0 commit comments

Comments
 (0)