Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
Izet Molla committed Aug 4, 2023
1 parent e82ad36 commit faa5d7e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/components/Box/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react';
import React, { FC, memo } from 'react';

import { View } from 'react-native';
import { usePropsResolution } from '../../hooks/usePropsResolution';
Expand All @@ -15,4 +15,4 @@ const Box: FC<BoxProps> = ({ children, ...props }) => {
return <View {...resolvedProps}>{children}</View>;
};

export default Box;
export default memo(Box);
4 changes: 2 additions & 2 deletions src/components/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react';
import React, { FC, memo } from 'react';

import { Button as BtnComp } from 'react-native';
import { usePropsResolution } from '../../hooks/usePropsResolution';
Expand All @@ -10,4 +10,4 @@ const Button: FC<ButtonProps> = ({ children, ...props }) => {
return <BtnComp {...resolvedProps}>{children}</BtnComp>;
};

export default Button;
export default memo(Button);
4 changes: 2 additions & 2 deletions src/components/Pressable/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { forwardRef, memo } from 'react';
import React, { memo } from 'react';
import { Pressable as RNPressable } from 'react-native';
import { usePropsResolution } from '../../hooks/usePropsResolution';

Expand Down Expand Up @@ -108,4 +108,4 @@ const Pressable = (
);
};

export default memo(forwardRef(Pressable));
export default memo(Pressable);
4 changes: 2 additions & 2 deletions src/components/Text/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react';
import React, { FC, memo } from 'react';

import { Text as TxtComp } from 'react-native';
import { usePropsResolution } from '../../hooks/usePropsResolution';
Expand All @@ -10,4 +10,4 @@ const Text: FC<TextProps> = ({ children, ...props }) => {
return <TxtComp {...resolvedProps}>{children}</TxtComp>;
};

export default Text;
export default memo(Text);
6 changes: 3 additions & 3 deletions src/contexts/ThemeUiProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, ReactNode, useState, createContext } from 'react';
import React, { FC, ReactNode, useState, createContext, memo } from 'react';
import defaultTheme, { ThemeUiTypes, ThemeActionTypes } from './theme';

interface ThemeUiProviderProps {
Expand All @@ -8,7 +8,7 @@ interface ThemeUiProviderProps {

const ThemeUiContext = createContext<ThemeUiTypes>(defaultTheme);
const ThemeUiActionContext = createContext<ThemeActionTypes>({
setThemeMode: () => {},
setThemeMode: () => { },
});

const ThemeUiProvider: FC<ThemeUiProviderProps> = ({
Expand All @@ -31,4 +31,4 @@ const ThemeUiProvider: FC<ThemeUiProviderProps> = ({
};

export { ThemeUiContext, ThemeUiActionContext };
export default ThemeUiProvider;
export default memo(ThemeUiProvider);
2 changes: 2 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ThemeUiProvider, {
ThemeUiContext,
} from './contexts/ThemeUiProvider';
import { useTheme } from './hooks/useTheme';
import Pressable from './components/Pressable';

export {
ThemeUiContext,
Expand All @@ -15,4 +16,5 @@ export {
Text,
useTheme,
Button,
Pressable
};

0 comments on commit faa5d7e

Please sign in to comment.