Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Tab Components? Seems to only load first tab component.. Example does it all with same Component #2939

Closed
jingoldby opened this issue Mar 14, 2018 · 1 comment

Comments

@jingoldby
Copy link

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.28
  • react-native v0.52.2

Expected behaviour

Should load GroupLeaderboard component listed under Scene key="group_leaderboard" when click tab for group_leaderboard with Actions.group_leaderboard(ActionConst.REFRESH);

Actual behaviour

GroupPage component is triggered again when navigate to group_leaderboard through Actions.group_leaderboard(ActionConst.REFRESH);

                            <Tabs
                                key="group"
                                title="Group"
                                overlay
                                icon={TabIcon}
                                showLabel={false}
                                tabBarPosition="top"
                                tabBarStyle={styles.groupTabBarStyle}
                                tabBarComponent={GroupTabs}
                                tabPage='group'
                            >
                                <Scene
                                    key="group_home"
                                    title="Activity"
                                    component={GroupPage}
                                    renderLeftButton={this.renderDrawerImage}
                                    icon={GroupIcon}
                                    renderTitle={this.renderTitle}
                                    hideNavBar
                                />
                                <Scene
                                    key="group_leaderboard"
                                    title="Leaderboard"
                                    component={GroupLeaderboard}
                                    renderLeftButton={this.renderDrawerImage}
                                    icon={GroupIcon}
                                    renderTitle={this.renderTitle}
                                    hideNavBar
                                />
                                <Scene
                                    key="group_chat"
                                    title="Chat"
                                    component={GroupPage}
                                    renderLeftButton={this.renderDrawerImage}
                                    icon={GroupChat}
                                    renderTitle={this.renderTitle}
                                    hideNavBar
                                />
                            </Tabs>
@asciifaceman
Copy link
Contributor

Refresh isn't quite what you think it is. It wont rerender the view unless you are passing in fresh props to change the state of what is rendered. Or if you use onEnter and a time delta to poll the backend to rerender.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants