react-navigation

How to properly reset navigation to another view

不羁岁月 提交于 2019-12-10 14:28:21
问题 I am resetting the current view with this code NavigationActions.reset({ index: 0, key: null, actions: [ NavigationActions.navigate({ routeName: 'Login' }) ] }); Some times it works and some time I get a Signal Sigabrt error on the RCTUIManager.m file in Xcode. I can't figure out when did the problem occur. The error happens in this function - (void)setSize:(CGSize)size forView:(UIView *)view { RCTAssertMainQueue(); NSNumber *reactTag = view.reactTag; dispatch_async(RCTGetUIManagerQueue(), ^{

undefined is not a function (evaluating 'decorator(target, property, desc)')

寵の児 提交于 2019-12-10 14:26:58
问题 I want to integrate mobx and mobx-persist with react-navigation. I read these articles: [1] https://hackernoon.com/react-navigation-with-mobx-2064fcdaa25b [2] https://blog.callstack.io/write-react-native-apps-in-2017-style-with-mobx-e2dffc209fcb [3] https://github.com/react-navigation/react-navigation/blob/8e8d3d562c9e80616f145f97ffb02dcf2048e67e/docs/guides/Mobx-Integration.md [4] MobX + React Native : way to inject stores [5] MobX - Why should I use `observer` when I could use `inject` when

A Custom Tab bar with two images in each tab using react navigation?

不想你离开。 提交于 2019-12-09 17:38:56
问题 I am creating an app using React Native for ios. Instead of having an active tintColor I want to have two little triangles (another image/icon) which appears when you are on the selected tab. It is important that the center y axis of the triangles is = to the y axis of the bottom of the tabbar image and that the tab icon is in the center of the triangles as seen below. At the moment I have the tab bar, the icons and navigation working - I just don't know how to make the triangles appear: ICON

How to get drawer over the header in react navigation?

微笑、不失礼 提交于 2019-12-09 17:22:05
问题 I am using react navigation. I want to show drawer over the header of the screen. Currently my header is not hiding below drawer when I open the drawer. import React from 'react'; import { View, Text, StyleSheet } from 'react-native'; import { createStackNavigator, createDrawerNavigator } from 'react-navigation'; import CategoryScreen from './CategoryScreen'; import ProductsScreen from './ProductsScreen'; import CartScreen from './CartScreen'; const drawerScreens = createDrawerNavigator ({

how to display headers in react navigation with TabNavigation

≡放荡痞女 提交于 2019-12-09 14:03:41
问题 I noticed that views in StackNavigation show the header title but if I set those same screens in a TabNavigation it doesn't show a header. It only shows a header if I wrap a StackNavigation either around each tab, or wrap the TabNavigation nested inside a StackNavigation. Why don't screens in TabNavigation show a header - is that expected behavior? If so, is it better to have a StackNavigation in each tab, or one big StackNavigation around the TabNavigation? // tabs navigation doesn't show a

How to call Screen / Component class method from react-navigation Header

做~自己de王妃 提交于 2019-12-09 13:24:45
问题 I need to call SearchScreen class method from a React Navigation Header. The Navigator look like this: Search: { screen: SearchScreen, path: 'search/:query', navigationOptions: { title: 'Search', header: { right: ( <MaterialCommunityIcons name="filter" onPress={() => { console.log(this); }} style={{marginRight: 15, color: 'white'}} size={24} /> ), }, } } 回答1: I've made it work by doing: // declare static navigationOptions in the Component static navigationOptions = { title: 'Title', header: (

how to use react-native-web and react-navigation together and access from web url

99封情书 提交于 2019-12-09 07:59:08
问题 UPDATE : react-navigation web support is done. follow this: https://reactnavigation.org/docs/en/web-support.html ORIGIN : I try to share my code between react-native and web. when I try react-native-web, it works well. but there is only one question, how to access the specific screen from URL? I read the react-navigation docs, there nothing about that. and react-router-native can catch the web URL, but it has navigator likes StackNavigator/DrawerNavigator. and idea about that? 回答1: I don't

Navigating to each item in FlatList

拈花ヽ惹草 提交于 2019-12-09 07:16:01
问题 I have a list of products and need to navigate to each product from that list and show data passed from HomeScreen do DetailsScreen.I'm trying to navigate between screens using react-navigation. I pass bellow JSON data as a state when I navigate to DetailsScreen. Can't find the right solution to navigate to a clicked product. How can I pass just one item of the array to next screen so when you open DetailsScreen you always have right data? Or can I somehow navigate with an index to exactly

React Native navigating between Nested StackNavigator

烂漫一生 提交于 2019-12-08 17:30:24
问题 I have the three navigators below, I am navigating to the DashBoard Screen after the login is completed but I have an issue when I want to logout from the DashBoard Screen, this.props.navigation.navigate('Login') is working fine but I want to clear the stack when signout button is pressed. const DashBoardStackNavigator = createStackNavigator({ DashBoard: DashBoard, Second:Second, Third:Third }) const BottomTabNavigator = createBottomTabNavigator({ DashBoardStackNavigator, Account, Report,

Check the render method of `Drawer Sidebar`

泄露秘密 提交于 2019-12-08 13:04:25
问题 I'm using React-navigation module, and I Created DrawerContent and I Got this Error: Check the render method of "Drawer Sidebar" How Can I Fix this Error? Default Code is ok: contentComponent: props => <ScrollView><DrawerItems {...props} /></ScrollView> My new Code is Not ok: contentComponent: DrawerContent and const DrawerContent = (props) => (<ScrollView><DrawerItems {...props} /></ScrollView>) I opened This Issue too: (https://github.com/react-community/react-navigation/issues/2175) 回答1: