Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui-router doesn't catch nested lazy loaded states #7

Closed
Hotell opened this issue Oct 29, 2016 · 5 comments
Closed

ui-router doesn't catch nested lazy loaded states #7

Hotell opened this issue Oct 29, 2016 · 5 comments
Labels
Milestone

Comments

@Hotell
Copy link

Hotell commented Oct 29, 2016

When I have state structure like this ( nested + lazily loaded )

// About 
const rootState = {
  name: 'about',
  url: '/about', 
  lazyLoad: () => System.import('./about').then(module=>module.states) 
}

// Contact
const aboutState = {
  name: 'about.contact',
  url: '/contact', 
  lazyLoad: () => System.import('./contact').then(module=>module.states)
}

About and nested Contact wont catch, when going directly to /about/contact, and transition to nothing, although About chunk loads, but that's it.

Here is the code:
https://github.com/ngParty/React-scaffold/tree/ui-router

Here is the gif:

ui-react-router-lazy-load-bug

@christopherthielen
Copy link
Member

https://ui-router.github.io/docs/latest/interfaces/state.statedeclaration.html#lazyload

I think that should be:

// About 
const rootState = {
  name: 'about',
  url: '/about', 
  lazyLoad: () => System.import('./about').then(module=>module.states) 
}

// Contact
const aboutState = {
  name: 'about.contact',
  url: '/contact', 
  lazyLoad: () => System.import('./contact').then(module=>module.states)
}

@Hotell
Copy link
Author

Hotell commented Oct 31, 2016

@christopherthielen
Copy link
Member

christopherthielen commented Oct 31, 2016

Thank you for the bug report. There is a fix coming in UI router core version 1.0.2
This is a problem with nested lazy states.

@Hotell
Copy link
Author

Hotell commented Oct 31, 2016

Awesome!

off topic question, what about ui-router with redux? Is there something planned? I can help with that. I'm currently migrating from RR2 to fantastic UI-Router but the redux thing is only missing piece to perfection.

thanks

@christopherthielen christopherthielen added this to the 0.4.0 milestone Oct 31, 2016
@elboman
Copy link
Member

elboman commented Oct 31, 2016

I'd like to discuss about the redux integration here (#9) to see what you had in mind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants