Skip to content

Navigating from each item in the GridView #40

@hrishikeshsoman

Description

@hrishikeshsoman

Hi,

I am trying to use GridView to list some movies in my project. Each movie item in the GridView is supposed to take the application to a movie detail page. I was trying to accomplish this using the Navigator component. Please find the code snippet here:

  renderScene = (route, navigator) => {
    switch (route.name) {
      case 'List':
        return (<GridView
          items={data.result}
          itemsPerRow={MOVIES_PER_ROW}
          renderItem={this.renderItem}
          style={styles.listView}
        />);
renderItem = (item) => {
   return <Movie movie={item} onPress={this.bookClicked} />
 }

I would like to pass a 'navigator' object to my Movie component from the switch statement. I am facing trouble in doing that. Any suggestions would be appreciated.

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