News Articles expo

Modify the value of the Tab Bar from a component (react-navigation 6)

I am trying to implement a color customization feature in my React Native app. I store two values, the main color and the secondary color, with AsyncStorage. Whenever I load a component, I call a function within ComponentDidMount() that get the two values and update the State (my State have mainColor and secondaryColor set to […]

React native: having issues with npm start after removing the node_modules

I am having issues running my expo app after deleting the node modules. I ran npm start but after trying to open it on an IOS simulator or the web, I got this: Unable to resolve module ./LocalAssets from /Users/mouhamadou/Documents/Dksen/dksen-app/node_modules/expo-asset/build/Asset.js: None of these files exist: * node_modules/expo-asset/build/LocalAssets(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json) * node_modules/expo-asset/build/LocalAssets/index(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json) > 1 | import { Platform […]

Wrap <App> in <Provider> for React Redux in React EXPO

How can wrap my whole app in for react redux? componentDidMount() { firebase.auth().onAuthStateChanged((user) => { if (user) { axios.post("/user/create", { name: user.displayName, email: user.email, }); console.log(user.displayName, user.email); } }); } render() { return ( <Provider store={store}> <NavigationContainer> <Tab.Navigator initialRouteName="Home" screenOptions={{ headerStyle: { elevation: 0 }, cardStyle: { backgroundColor: "#E5E5E5" }, }}> <Tab.Screen name="Home" component={HomeScreen}></Tab.Screen> <Tab.Screen […]

FormData is not working fine with Expo CLI React native

recently I got an issue with uploading documents functionality in Expo CLI – React native, the issue is the file is not delivering to the backend like FormData() it arrives in a weird array, not like the website at all, I got the same endpoint connected to React JS project and it works fine and […]

How do I stop <TouchableOpacity> from taking up the whole row and being pressable from anywhere in that row?

I’m creating a custom header and I don’t want the back button to be pressable from anywhere in the row. Not sure how to fix this, I don’t have any flex: 1 applied. export default function IconButton({ iconName, color, size, onPress, style }) { return ( <TouchableOpacity style={[style]} onPress={onPress}> <MaterialCommunityIcons name={iconName} size={size} color={color} /> </TouchableOpacity> […]

Expo "Cannot GET /" when passing parameter

I have completely blank expo app. When I type on iPhone in safari deep link: exp://192.168.xxx.xxx:19000, it starts the app correctly. When I try to pass parameter: exp://192.168.xxx.xxx:19000?param=test, it opens the expo app but with this error: <!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <title>Error</title> </head> <body> <pre>Cannot GET /</pre> </body> </html> Source: React – Stack […]

React Native: Using Canvas to make an Image Editor with Blur Effect

I’m trying to make an AI Image Editor, and I have an API which auto removes background pretty nicely and I thought to use that API to make a auto background blur app, I first tried it as a normal webpage, below is the working code to that, What I’m doing here is, first I […]

Error RN :Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate

I’m getting data from WordPress API and showing it in react native application. Getting this error only after adding component even I’m trying to parse a simple paragraph. This is my code – import React from "react"; import { ActivityIndicator, Text, View, ScrollView, Image, Dimensions, } from "react-native"; import HTML from "react-native-render-html"; import globalStyles from […]

Modify OpenWeatherMap Geocoding API response to only show city

I’m using OpenWeatherMap’s reverse geocoding API to show the current city the user is located in. I’ve managed to show the weather based on the location but struggling with the reverse geocoding part. The API call is successful but I am unsure on how to modify the response to only give me the city name. […]

TypeError: Cannot read property ‘users’ of undefined | but users is defined

I’m having this error now and I dont know why. I get that the line of error is in this code, but I don’t see what I did wrong. const found = getState().usersState.users.some(el => el.uid === uid); The Code : import { USER_STATE_CHANGE, USER_POSTS_STATE_CHANGE, USER_FOLLOWING_STATE_CHANGE, USERS_DATA_STATE_CHANGE } from "../constants/index"; import firebase from "firebase/app"; import ‘firebase/firestore’ […]

useState is not working properly in React Native

I’m working on an application and using WordPress API for showing posts. I’ve created 2 buttons to navigate the list of posts. As you know there is an argument "page=" to get posts on a specific page, I’ve initialized a state to maintain page number. The main problem is that it’s not incrementing correctly. Post […]

useState is not working properly in React Native

I’m working on an application and using WordPress API for showing posts. I’ve created 2 buttons to navigate the list of posts. As you know there is an argument "page=" to get posts on a specific page, I’ve initialized a state to maintain page number. The main problem is that it’s not incrementing correctly. Post […]

useState is not working properly in React Native

I’m working on an application and using WordPress API for showing posts. I’ve created 2 buttons to navigate the list of posts. As you know there is an argument "page=" to get posts on a specific page, I’ve initialized a state to maintain page number. The main problem is that it’s not incrementing correctly. Post […]

useState is not working properly in React Native

I’m working on an application and using WordPress API for showing posts. I’ve created 2 buttons to navigate the list of posts. As you know there is an argument "page=" to get posts on a specific page, I’ve initialized a state to maintain page number. The main problem is that it’s not incrementing correctly. Post […]

React Native : clean Useeffect

I ma facing this issue Warning: Can’t perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function. useEffect(() => { firebase.auth().onAuthStateChanged((user) => { if (user !== null) { return firebase […]

React native app crash when app more layers of view components

when ever I add this line of code in my react native app it crashes.The expo app closes with out no error being thrown to the console and its quite hard to debug because I don’t see anything wrong with the code. What am thinking is it is wrong to have many views inside of […]

Use style-loader / css-loader in Expo Web (react-native-web)

I want to use codegen.macros to load different libs based on web or native output. But my web components need to load css / scss files. I really googled the heck out of me, but I can’t find a running example how to adjust webpack.config.js to have a css/scss loader running with Expo Web (react-native-web). […]

Expo managed app eas ios build : "Metro encountered an error: Cannot read property ‘transformFile’ of undefined"

I’m working on a managed expo app and I use eas services. I try to make an internal distribution build, on android it’s ok but on my ios build fail with this error : Metro encountered an error: Cannot read property ‘transformFile’ of undefined ▸ PhaseScriptExecution Bundle React Native code and images /Users/expo/Library/Developer/Xcode/DerivedData/greengot-djveyphpwyosjubjkipdmcftptmp/Build/Intermediates.noindex/ArchiveIntermediates/greengot/IntermediateBuildFilesPath/greengot.build/Debug-iphoneos/greengot.build/Script-00DD1BFF1BD5951E006B06BC.sh Here is […]

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.