I’ve been trying to get up and running with react navigation but I run into a problem when I try to move navigation items into their own components. HomeScreen.js Then in the NavButton component I try to navigate to the new screen. But I keep getting the error “Cannot read property ‘navigate’ of undefined. Here is my Router.js file as
Tag: react-native
React native – prevent user from going back to login screen
I’ve created a Login button using Facebook SDK. Once the user is logged in, the app navigates to the second screen (NavigatorIOS). From that second screen the user can go back to the login screen using the navigation (back button). How can I prevent the user from going back to the Login screen if he is already logged in? index.ios.js
show 2 items per row[react native]
I am learning react native and in all the tutorials i see ListView has been used with only 1 items per row. I have not used ListView, though. I have only 6 items that has to be shown as flat grid with 2 items per row and should be responsive. I know its a basic question, but i have tried
React-Native: How to open google play store from react native app?
I am trying to find a way how to open the google play store with my application when the user is pressing a button inside of the react-native application. Is there a way how to do this? Answer You can use deeplinking to redirect your user from your app using this: https://developer.android.com/distribute/tools/promote/linking.html and the Linking API from react-native: http://facebook.github.io/react-native/docs/linking.html
Lose focus and dismiss keyboard on clicking outside of the TextInput field in react native?
I have already researched about it and found this post: react-native: hide keyboard But this didn’t work for me. When I touch the portion of the screen thats outside the text input field, I was expecting that the input field will lose focus and the keyboard will get dismissed. But, nothing is happening. The cursor keeps blinking on the input.
How to initialise array in react-native using es6?
I am trying to create empty array in react-native using es6. But while accessing it I get an error data not defined. Here is the code snippet which I am using to initialise the array. Here is the code through which I am trying to populate the array and at the same time logging it I think so there is
How to transform an object into an array of objects?
I am looking for a way to transform an object into an array of objects, and remove the first unique key. How can I make this: into this: so I can .map through it like this: Answer You can use Object.keys() to get array of keys and then map() to change keys to values or in this case objects.
Can’t show Image in React Native
I’m using react-native 0.28.0 I’m trying to show an image on iPhone simulator according to this tutorial: Introduction to React Native: Building iOS Apps with JavaScript | Appcoda Then in the render() function, I add this: The space allocated for the image is there, but the image is not shown. Answer In addition to Jonathan Stellwag’s answer, the 1st solution
React-Native fetch, Network request failed. Not using localhost
I have an app, which I’m using fetch to authenticate user. It was working until few days ago and I haven’t change anything. Just upgraded from react 0.27 to 0.28, not fetch is not working. I have searched for almost 2 days and I have read almost all questions in Stack Overflow. Most of users trying to fetch something from
Can’t open dev menu via CMD+D or reload via CMD+R any longer
I can’t open my dev menu via CMD+D or reload via CMD+R any longer. It just stopped working without me knowingly changing something. Some more info: Shake gesture still works, but not always Live reload works only when shake gesture is working Independent of build via react-native run-ios or via xCode rn22.0 and rn23.0-rc same behaviour upon react-native init newProject