react-navigation

Nested Drawer-StackNavigator, firing “DrawerOpen” is not working on React-Native

陌路散爱 提交于 2020-01-11 11:24:29
问题 I'm making app with using React Native with react-navigation. [My App's hierarchy] *Drawer(App) ㄴ StackNavigator ㄴ StackNavigator What I want to is fire navigation.navigate('DrawerOpen'); I can show my Drawer by dragging from left edge but it's not triggered by pressing "Menu button" on the left of Navigation header. I've spent so many times to archive this. Please help me. const Nav = StackNavigator({ mainnav_list:{ screen: (props) => <TodoList {...props} dbCollectionName={props.screenProps

How to create a Drawer Component and adding it to multiple screens

本小妞迷上赌 提交于 2020-01-09 11:31:16
问题 Hi i want to create a component by using a createDrawerNavigator , and want to add it all screens could you help me. 回答1: In the below example don't copy all the syntax understand the concept from my explanation I have configured redux and many other imports you may not need so configure and include content in below files as you need. File name - BurgerMenu.js import React, { Component } from "react"; import SideBar from "./SideBar.js"; import News from "../../Containers/News"; // import your

React Native — Tab Navigator example

倖福魔咒の 提交于 2020-01-07 06:35:10
问题 I'm new in react native development.I want to implement tabbar with stack navigator in react native.Tabbar shows proper. While tap on settingsscreen "Go Home" button not navigating to country screen.Its seems simple but since i am new i dont have much idea. index.ios.js import React, { Component } from 'react'; import { AppRegistry,View,Text } from 'react-native'; import MNavigator from './Components/MNavigator'; AppRegistry.registerComponent('*****', () => MNavigator); MNavigator.js import

React Native Router Flux: Transition and history using this same scene but with other parameters

五迷三道 提交于 2020-01-06 07:29:11
问题 I'm creating a shop app and I'm using react-native-router-flux as a router. Currently, I have just few scenes like product list, product info, basket and checkout. But I need to create a navigation. I have JSON with whole navigation structure, where ID of category is the ID for call to API when ProductList scene calls componentDidMount(). But I don't know how to: a) use this same scene but with additional parameters and refresh it -- I suppose that I should do something like Actions.refresh({

Passing props to tabNavigator's screens

三世轮回 提交于 2020-01-06 06:36:26
问题 In my app, I want to pass some data in my createMaterialTopTabNavigator (const NewTab) to both it's child screens (Graphical and Tabular). The data in child screens changes on the basis of the dropdown value in the custom header that will be above createMaterialTopTabNavigator. As soon as the value from the dropdown is selected, it will trigger a fetch request in both the Graphical and Tabular Screen. Here is my App.js where I am routing all my screens. const NewTab =

Navigate when clicking on image doesn't work

本小妞迷上赌 提交于 2020-01-06 05:53:13
问题 I've been trying to be able to change screens by clicking on the Image within the code but it isn't working. I've tried defining Push, navigate and other props but it always says that undefined is not an object and show the prop. import React from 'react'; import { AppRegistry, StyleSheet, View, Image, TouchableOpacity, Button } from "react-native"; import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen' import { StackNavigator,

module appregistry is not a registered callable module (calling runApplication)

点点圈 提交于 2020-01-06 05:51:07
问题 i cannot find a way to make react-navigation work at all. i copied the working examples from the internet but they don't seem to work too. can someone tell me what i am doing wrong. i'm using node: 8.9.4 react: 16.3.0-alpha.1 react-native: 0.54.0 react-navigation: ^1.4.0 //index.js import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View } from 'react-native'; import { TabNavigator, StackNavigator } from 'react-navigation'; import Home from './first'; import

Are you able to programmatically generate screens inside React Navigation Tab Navigator

泄露秘密 提交于 2020-01-06 05:30:08
问题 Using React-Navigation, I am trying to generate an unknown number of tabs based off of the values that I've drawn from an array, and pass the data from that array value into the screen. For example, if I have 2 accounts, I would expect 2 tabs with screens for each one, but if I have 5 accounts, there are 5 tabs, with their own screens that are generated programatically from the values that are sent across from the database. What I have so far, and what I am trying to do is: interface Account

How can I create or delete tabs in React Navigation based on the data fetched from API?

心已入冬 提交于 2020-01-06 04:37:04
问题 Let's say there is a tab view which has tabs with names Breads, Pizzas, Beverages, Desserts, Shakes. And the name of these tabs are fetched from API. Also, the information for each tab to show on their respective screens is fetched from the API too. Now, when one of the Tab's data gets deleted from the API. I want it to be removed from the Tab View too. How can I achieve this in React Navigation? 回答1: In react navigation we cannot have dynamic tab, as we have to define all the routes

icons not showing on TabNavigator

走远了吗. 提交于 2020-01-06 03:21:12
问题 Icon not showing in TabNavigator. My code: import React, { Component } from 'react'; import { AppRegistry, Text, View } from 'react-native'; import { StackNavigator,TabNavigator } from 'react-navigation'; import TestComp1 from './src/components/TestComp1' import TestComp2 from './src/components/TestComp2' import TestComp3 from './src/components/TestComp3' import TestComp4 from './src/components/TestComp4' import TestComp5 from './src/components/TestComp5' export default class myApp extends