Skip to content

Commit 9e63a78

Browse files
committed
add preloading for FAB icons
1 parent 6d289e3 commit 9e63a78

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/components/FloatingCameraButton/BaseFloatingCameraButton.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import React, {useState} from 'react';
1+
import React, {useEffect, useState} from 'react';
22
import {View} from 'react-native';
33
import type {OnyxCollection} from 'react-native-onyx';
44
import Icon from '@components/Icon';
5+
import {loadExpensifyIconsChunk} from '@components/Icon/ExpensifyIconLoader';
6+
import {loadIllustrationsChunk} from '@components/Icon/IllustrationLoader';
57
import {PressableWithoutFeedback} from '@components/Pressable';
68
import useLocalize from '@hooks/useLocalize';
79
import useOnyx from '@hooks/useOnyx';
@@ -33,6 +35,11 @@ function BaseFloatingCameraButton({icon}: BaseFloatingCameraButtonProps) {
3335
const styles = useThemeStyles();
3436
const {translate} = useLocalize();
3537

38+
useEffect(() => {
39+
loadIllustrationsChunk();
40+
loadExpensifyIconsChunk();
41+
}, []);
42+
3643
const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID);
3744
const [activePolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${activePolicyID}`);
3845
const [session] = useOnyx(ONYXKEYS.SESSION, {selector: sessionEmailAndAccountIDSelector});

0 commit comments

Comments
 (0)