Skip to content

Commit

Permalink
Don't memoize Box and Pressable
Browse files Browse the repository at this point in the history
Don't memoize Box and Pressable since having children forces
to always re-render.
  • Loading branch information
maurobender committed Oct 18, 2022
1 parent 68bc9af commit 87908e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/main/Box/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { forwardRef, memo } from 'react';
import React, { forwardRef } from 'react';
import { View } from 'react-native';
import type { ComponentProps } from '../../../core/styles/types';
import { useComponentPropsResolver, useStyleFromPropsResolver } from '../../../hooks';
Expand All @@ -21,4 +21,4 @@ const Box = ( { children, ...props }: IBoxProps, ref: React.Ref<View> ) => {
);
};

export default memo( forwardRef( Box ) );
export default forwardRef( Box );
4 changes: 2 additions & 2 deletions src/components/main/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, { forwardRef } from 'react';
import { Pressable as RNPressable, View } from 'react-native';
import type { ComponentProps } from '../../../core/styles/types';
import { useComponentPropsResolver, useStyleFromPropsResolver } from '../../../hooks';
Expand All @@ -23,4 +23,4 @@ const Pressable = ( {
);
};

export default memo( forwardRef( Pressable ) );
export default forwardRef( Pressable );

0 comments on commit 87908e9

Please sign in to comment.