ga-wdi-exercises/project4

react routing

Closed this issue · 2 comments

I've listed each team upcoming game schedules as so...

let schedule = this.props.schedule.map((game, i) => {
      let pathname = `/teams/${game.team_id}/games/${game.id}`
      return <div key={i}><Link to={{pathname}}>{game.date} vs {game.opp}</Link></div>

I'd like that when I click on an individual game it will take me to a game 'show' page with just that game listed. the route is changing in the url bar correctly, and also the component to be rendered when clicked is coming up, but I can't get rid of the list of games I'm currently looking at from the screen. I think it has to do with Componentdidmount in order to have it re-render the page, but i'm having trouble getting it to work. Thanks

a lot of code was removed from above by this text program... see if this works....

let schedule = this.props.schedule.map((game, i) => {
      let pathname = `/teams/${game.team_id}/games/${game.id}`
      return <div key={i}><Link to={{pathname}}>{game.date} vs {game.opp}</Link></div>

I actually managed to solve this issue gentlemen. Sorry for the disturbance