Skip to content

props not passed when switching tabs #364

@rgovindji

Description

@rgovindji

When load the initial tab the "viewer" prop is populated correctly but if I switch to another tab I get a "viewer is undefined" error.

const scenes = Actions.create(
<Scene key="main">
        <Scene key="tabbar" hideTabBar={false}  tabs={true}  >
          <Scene key="Profile" component={ProfilePage} initial={true} icon={TabIcon} iconLabel="ios-paper" title="Profile" />
          <Scene key="NewsFeed" component={NewsFeedPage} icon={TabIcon} iconLabel="ios-home" title="News Feed" />
        </Scene>
    </Scene>
);

export default class SampleApp extends Component {
  render() {
    return (
      <Router scenes={scenes} {...this.props} sceneStyle={styles.pageViewStyle} />
    );
  }
}

export default Relay.createContainer(SampleApp, {
  fragments: {
    viewer: variables => Relay.QL`
      fragment on Viewer {
        id
        ${NewsFeedPage.getFragment('viewer')}
        ${ProfilePage.getFragment('viewer')}
      }
    `,
  },
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions