Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

How to link to a detail view in a different tab #65

Open
eaco-andrew opened this issue Feb 26, 2018 · 0 comments
Open

How to link to a detail view in a different tab #65

eaco-andrew opened this issue Feb 26, 2018 · 0 comments
Assignees
Projects

Comments

@eaco-andrew
Copy link

Question
How to you link to a detail view in a different tab?

What is the current behavior?
When I click on the link in the root view, on the item page the back button goes back to the root view. How do you make it go back to the items view?

What is the expected behavior?
That it would go back to the items view

Environment (include versions). Did this work in previous versions?

  • Device: iPhone 8 simulator
  • OS: iOS 11
  • React-Native (version): 0.53.3
  • React-Router (version): 4.2.0
  • React-Router-Navigation (version): 1.0.0-rc.4
import React, {Component} from 'react'
import {
    Text,
    View,
} from 'react-native'
import {NativeRouter, Link} from 'react-router-native'
import {BottomNavigation, Navigation, Card, Tab} from 'react-router-navigation'

export default class App extends Component<Props> {
    render() {
        return (
            <NativeRouter>
                <BottomNavigation>
                    <Tab
                        label="Root"
                        exact
                        path="/"
                        render={() => (
                            <View style={{marginTop: 50}}>
                                <Text>Root View</Text>
                                <Link to={'/items/1'}>
                                    <Text>Go to Item 1</Text>
                                </Link>
                            </View>
                        )}/>
                    <Tab
                        label="Items"
                        path="/items"
                        render={() => (
                            <Navigation>
                                <Card path="/items/:id" render={() => (
                                    <View>
                                        <Text>Item 1 View</Text>
                                    </View>
                                )}/>
                                <Card path="/items" render={() => (
                                    <View>
                                        <Text>Items View</Text>
                                        <Link to={'/items/1'}>
                                            <Text>Go to Item 1</Text>
                                        </Link>
                                    </View>
                                )}/>
                            </Navigation>
                        )}/>
                </BottomNavigation>
            </NativeRouter>
        )
    }
}
@LeoLeBras LeoLeBras self-assigned this Oct 11, 2018
@LeoLeBras LeoLeBras added this to In progress in v2 Oct 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
v2
  
In progress
Development

No branches or pull requests

2 participants