markdalgleish / redial

Universal data fetching and route lifecycle management for React etc.
1.1k stars 42 forks source link

Handle undefined components #7

Closed cameronhunter closed 8 years ago

fusepilot commented 8 years ago

Please merge.

I was getting TypeError: Cannot read property 'fetchers' of undefined and this fixed it.

4 might be related, same error.

markdalgleish commented 8 years ago

Can I ask why any of your components in the array would be undefined?

cameronhunter commented 8 years ago

Yeah, sure – the component would be undefined in this situation:

<Route path="/">
  <IndexRoute component={Home} />
  <Route path="/:page" component={Page} />
</Route>

The outer <Route> would have an undefined component.

markdalgleish commented 8 years ago

Oh, cool, that makes perfect sense. I'll try and get a patch out for this soon.

markdalgleish commented 8 years ago

Haha, sorry, just realised this is a PR. The code in master has changed a bit, would you mind updating your PR?

cameronhunter commented 8 years ago

I've created a new pull request: #10