After saving a file using react-native-fs where does that file go? It’s not explained in the documentation or I couldn’t find and it’s hard to figure. Answer When you create a file you have to specify a directory where to store the file. In the example below the path variable shows where the…
Tag: react-native
Can you track background geolocation with React Native?
Problem I’d like to be able to track a users location even when the app is no longer in the foreground (e.g. The user has switch to another app or switched to the home screen and locked their phone). The use case would be a user tracking a run. They could open the app and press ‘start’ at th…
How to fetch .json data from URL?
I have problem with fetching data from URL. When I write data inside of a file, app works great, but when I try to call same data from URL, I get error. I made a test with small app where everything was inside of a App.js file, and it worked. But new app is kinda devided in multiple files, and
behavior of arrow function vs normal function in onPress method
‘m learning native react and learning more about javascript, so I still do not understand many things about its behavior. I have created a button component, using TouchableOpacity, and its props onPress. For it to work, I must send the function I want to execute as a props, but here I have fallen due to…
How to call a parent function from a child – react-native
I’m struggling to find a solution to my problem , but i cannot find it anywhere . So my question is how to call a parent function from a child . The function has to be passed in a onPress={()} inside the child Parent.js Child.js } Answer This is a common mis-understanding, so you’re in good hands.…
Firebase database – filtering and ordering query
I’m working on a React Native app, and trying to set up a user research in the database, based on a given text. Here is my request code : Database looks like : The query returns what I want, but I have an error on each query only saying “@firebase/database:”. And nothing else… How can …
Remove last char string when string contains emojis
I’m using React Native (chat), in this app I have one emoji picker but when users press virtual backspace button emojis only remove their last unicode byte. How can I detect if last ‘chat’ (set of unicodes) is standalone emoji unicode? Code to split it: I also tried to use Array.from(), then…
react-native-svg-charts animate does not work
I would like to know how to animate chart on react native iOS when I’m using react-native-svg-charts or if someone can help me to find another library chart with visualization data. I tried to use the animate prop of the StackedAreaChart but it has no results! Here is my code : Any idea? Answer What do …
Sending states between screens react native
Am currently working with an app that will provide you with a class/race/background story from an fantasy api. I used expo’s tab template when i created the project. So my question is how would I send data that i fetched in my Race screen to my background-story screen in order to fetch the correct backg…
Using the spread operator in styled components
Is it possible to use the spread operator with a styled component in React Native? I have this component: But lets say that in my theme, I have an object that has both the fontFamily and the fontSize, and I re use all over the app. I would like to be able to know if I can do something like