You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I burned a few hours attempting to fix an issue that was actually a side-effect of unintentionally calling start() on my router object twice – once in my router.config file (inspired by the sample app,) and then once again by passing router to the UIRouter component.
The trouble is, it isn't particularly obvious that passing a UIRouterReact class to a UIRouter component (<UIRouter router={router}></UIRouter>) automatically calls the start() method on router.
Since I can't actually think of any reason why a user would choose to call router.start() twice in the same application, it may be prudent to throw an error if a user attempts to do so.
The text was updated successfully, but these errors were encountered:
Yeah, we should definitely warn the user if the start method is called more than once.
The thing is, since the UIRouter component takes care of start()ing the router whether you pass it an instance or let it create the instance for you, I don't think you ever need to do it yourself.
We should definitely update the sample app (as it's using the old version/syntax) as well as migration guide from the 0.4.x
I burned a few hours attempting to fix an issue that was actually a side-effect of unintentionally calling
start()
on myrouter
object twice – once in myrouter.config
file (inspired by the sample app,) and then once again by passingrouter
to theUIRouter
component.The trouble is, it isn't particularly obvious that passing a
UIRouterReact
class to aUIRouter
component (<UIRouter router={router}></UIRouter>
) automatically calls thestart()
method onrouter
.Since I can't actually think of any reason why a user would choose to call
router.start()
twice in the same application, it may be prudent to throw an error if a user attempts to do so.The text was updated successfully, but these errors were encountered: