I am creating a React Native app using React Navigation version 5, and I have a bottom tab navigator with a stack navigator nested inside each screen of the tab navigator. I only want the bottom tab bar to show when on the first page of each stack navigator. Here is a snack that displays my app’s basic …
Tag: react-native
‘useEffect’ hook only fires once?
I am working of a Guessing Game for ‘React Native’ where the user enters a number and the phone tries to guess it. Each time the phone generates a guess the user can click Greater/Lower. When the user entered number and the computer made guess equal each other we are taken to the game over screen.…
React Native, in a text string, change color of words having # or @ in start just like twitter
I have a text string some of words are having # or @ as prefix (in start of words, just as #example or @example) i want to change such words into blue color . React Native Answer You can use a custom component like below. You can check the working snack https://snack.expo.io/@guruparan/demo2
Error: Looks like you have nested a ‘NavigationContainer’ inside another. Normally you need only one container at the root of the app
I followed the docs of React 5 for Drawer Navigation in react native but getting this error. Here is my Code I am new to react native, so don’t know what to do Answer You only need to declare one < NavigationContainer > in the top component, example:
Expo + React Native: Draw line between coordinates on two type of views
I am currently using this module: https://github.com/mxmzb/react-native-gesture-detector. I want to be able to draw a line from the points created. however, it only seems to output circles. It has a “Create Gesture” view: GesturePath is defined like so: When you draw on that view, it outlines the …
React Countdown Timer unable to make a stop function
I am practically new to React. In this App I am using Hooks! I’ve made a Countdown Timer that will show in a few seconds after logging in. I am unable to make it stop on a button click. I need some advise on this as I’ve been struggling for the past 2 days with this. This is my code
Unable to resolve “@react-native-community/masked-view
I am using react native expo version 37.0.3 and every time I run the app I am getting this error` I don’t have any idea why this error is coming Here is the screenshot of error on my mobile screen Answer You haven’t followed the installation instructions for React Navigation. Since you’re us…
Fetch JSON file from url in Javascript, React Native
I have a problem fetching JSON data from url. I would really appreciate it if you could help me solve this issue. I wanted to fetch JSON data from firebase storage, but somewhat I can’t, so I simplified the code and now it’s really simple, but no luck. I also searched the cause of the error in thi…
Couldn’t find a ‘component’ or ‘children’ prop for the screen ‘Home’. This can happen if you passed ‘undefined’. Error with react-navigate v5?
I’m trying to use react-navigate v5 to setup a stacknavigator for four screens. Currently I’m getting this error while trying to run the app: My App.js: My Navigator.js: And the home screen itself that’s generating the error (the other screens do too): Not sure what’s going on, would a…
Difference between synchronous and asynchronous functions
I have just started react-native development and came across async functions. Can someone explain a thing or two about it in layman’s terms. I have tried reading articles on it but they all tend to explain it in a very technical way which is a little confusing. I have used other languages but javaScript…