Relative Content

Tag Archive for reactjsreact-nativereact-hooks

Notifee Custom Sound works in foreground, not in background and kill mode in React Native

const queryClient = new QueryClient(); const Root = (props) => { const { hasNotifPermission, requestNotifPermission } = useNotificationsPermission(); useEffect(() => { LogBox.ignoreAllLogs(); LogBox.ignoreLogs([‘VirtualizedLists should never be nested’]); }, []); useEffect(() => { const notifPerInit = async () => { await requestNotificationPermission(); }; notifPerInit(); messaging().onNotificationOpenedApp((remoteMessage) => { console.log( ‘Notification caused app to open from background state:’, […]

React Native preventing re-rendering of object element in array that is not updated

I am trying to figure out this for days, but my component ImageComponent is flickering when I click add or remove for all the elements in the array. I think the issue is that all elements in the array is re-rendering when one element is updated. How can I fix this? I have been trying using memo and useMemo, as well as useCallback, but none worked… could anyone figure this out, please?

how to fix setState delay in react-native?

This question may be duplicate. But i didn’t find any solution hence posting it.
I have a screen. In useEffect i am calling api before that i am setting loader to true using useState but loader shows after delay of 1-2 sec.
how can i avoid delay. is there any other way?