adrianhorning08 / vinyasa

Asana clone. Rails backend, React frontend.
8 stars 3 forks source link

Team Index won't render #5

Closed adrianhorning08 closed 6 years ago

adrianhorning08 commented 6 years ago

Interestingly enough, this is the same type of issue I had previously. The state is being updated with the teams, so it is fetching the data, but then react isn't re-rendering.

adrianhorning08 commented 6 years ago

Ok, it looks like it is re-rendering. I can see that in render that teams has been updated. But nothing is showing up on the screen. I wonder if its because of the div I have colored in the background. I just checked out the console and it looks like there is a ul and li, but no content....

adrianhorning08 commented 6 years ago

Got it!!!!!! Turns out, what gets passed to the TeamIndexItem was: { team { name: 'Rogue Squadran' } } So I'll have to figure out why it was nested all crazy. Must be something to do with my reducer.

adrianhorning08 commented 6 years ago

Ah, got it, I was just passing in stuff wrong. Instead of passing in props, I was passing in team. So it looked like team.team.name, but it really is props.team.name. export const TeamIndexItem = (team) => { return (

  • {team.team.name}
  • ); };