Skip to content

Commit 16acd5f

Browse files
authored
Merge branch 'develop' into mmkv-storage-update
2 parents 1306569 + 53e26da commit 16acd5f

File tree

129 files changed

+860
-218
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+860
-218
lines changed

.eslintrc.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
}
1515
},
1616
parser: '@babel/eslint-parser',
17-
extends: ['plugin:jest/recommended', '@rocket.chat/eslint-config', 'prettier'],
17+
extends: ['plugin:jest/recommended', '@rocket.chat/eslint-config', 'prettier', 'plugin:react-hooks/recommended'],
1818
parserOptions: {
1919
sourceType: 'module',
2020
ecmaVersion: 2017,
@@ -36,6 +36,9 @@ module.exports = {
3636
'jest/globals': true
3737
},
3838
rules: {
39+
'react-hooks/set-state-in-effect': 1,
40+
'react-hooks/immutability': 1,
41+
'react-hooks/refs': 1,
3942
'import/named': 'error',
4043
'import/no-unresolved': 'error',
4144
'import/extensions': [

app/containers/ActionSheet/BottomSheetContent.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ interface IBottomSheetContentProps {
2020
}
2121

2222
const BottomSheetContent = React.memo(({ options, hasCancel, hide, children, onLayout }: IBottomSheetContentProps) => {
23+
'use memo';
24+
2325
const { colors } = useTheme();
2426
const { bottom } = useSafeAreaInsets();
2527
const { fontScale } = useWindowDimensions();

app/containers/ActionSheet/Handle.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { themes } from '../../lib/constants/colors';
66
import { useTheme } from '../../theme';
77

88
export const Handle = React.memo(() => {
9+
'use memo';
10+
911
const { theme } = useTheme();
1012
return (
1113
<View style={styles.handle} testID='action-sheet-handle'>

app/containers/ActionSheet/Item.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export interface IActionSheetItem {
1616
}
1717

1818
export const Item = React.memo(({ item, hide }: IActionSheetItem) => {
19+
'use memo';
20+
1921
const enabled = item?.enabled ?? true;
2022
const { colors } = useTheme();
2123
const { fontScale } = useWindowDimensions();

app/containers/ActionSheet/Provider.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ export const withActionSheet = (Component: React.ComponentType<any>): typeof Com
5454
const actionSheetRef: React.Ref<IActionSheetProvider> = createRef();
5555

5656
export const ActionSheetProvider = React.memo(({ children }: { children: React.ReactElement | React.ReactElement[] }) => {
57+
'use memo';
58+
5759
const getContext = (): IActionSheetProvider => ({
5860
showActionSheet: options => {
5961
actionSheetRef.current?.showActionSheet(options);

app/containers/Header/components/HeaderBackButton.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ const styles = StyleSheet.create({
2020
});
2121

2222
export const HeaderBackButton = ({ ...props }: HeaderBackButtonProps) => {
23+
'use memo';
24+
2325
const { colors } = useTheme();
2426
return (
2527
<RNHeaderBackButton

app/containers/Header/components/HeaderButton/HeaderButtonItem.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ const Item = memo(
5353
accessibilityLabel,
5454
...props
5555
}: IHeaderButtonItem): React.ReactElement => {
56+
'use memo';
57+
5658
const { colors } = useTheme();
5759
return (
5860
<BorderlessButton

app/containers/Header/components/HeaderContainer/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ interface IHeaderContainer extends ViewProps {
1313

1414
const HeaderContainer = memo(
1515
({ addExtraNotchPadding = false, isMasterDetail = false, customRightIcon, customLeftIcon, children }: IHeaderContainer) => {
16+
'use memo';
17+
1618
const insets = useSafeAreaInsets();
1719
const { colors } = useTheme();
1820
const { height, width } = useWindowDimensions();

app/containers/Header/components/HeaderTitle/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ interface IHeaderTitle {
1010
}
1111

1212
const HeaderTitle = memo(({ headerTitle }: IHeaderTitle) => {
13+
'use memo';
14+
1315
const { colors } = useTheme();
1416
if (!headerTitle) {
1517
return null;

app/containers/Header/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import { HeaderBackButton } from './components/HeaderBackButton';
1212
interface IHeader extends NativeStackHeaderProps {}
1313

1414
const Header = ({ options, navigation, route }: IHeader) => {
15+
'use memo';
16+
1517
const { headerLeft, headerTitle, headerRight, title } = options;
1618
const [rightButtonsWidth, setRightButtonsWidth] = useState<number | null>(null);
1719
const isMasterDetail = useAppSelector(state => state.app.isMasterDetail);

0 commit comments

Comments
 (0)