-
Notifications
You must be signed in to change notification settings - Fork 128
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
transition to another state. #64
Comments
Well, I guess the two main options here are:
render () {
return (
<UISref to="mystate">
<a>My state</a>
</UISref>
)
}
navigateToMyState () => {
const {stateService} = this.props.transition.router;
stateService.go('mystate');
}
render () {
return (
<Child onNavigate={this.navigateToMyState} />
)
} This way |
Gotcha, I passed down the function to the child and when try using the stateService.go I receive this error:
The code will route to the state but the url doesn't change to the states url. |
Resolved the issue by adding the plugin: hashLocationPlugin |
Wait, you weren't using a location plugin or did you simply change it from Can you please show me your state declaration code? Because it looks like there's something off with the I guess you meant it to change to |
This is my state declaration:
Here is my router config:
Here is how I am initializing the UIRouter. ()
Here is the ReactDOM render...
|
Still not sure, but I can see you are adding the You haven't said if the fix by adding the |
As this issue is a bit old, it is being closed. If you feel like the problem reported is still valid, please add a comment saying it is still affecting you. We will reevaluate it and if it is valid we will reopen it. Thank you for supporting and contributing to the project. |
With React being very very component based. How do I transition from one state to another?
I am seeing calling transition.router.stateService.target or .go but that is only accessible from the parent state. Not accessible from the child components that are building that parent state.
Thanks. Sorry if I am missing something.
The text was updated successfully, but these errors were encountered: