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

React state components do not unmount / remount when stateTransition.reload(true) is called #172

Closed
christopherthielen opened this issue May 5, 2018 · 2 comments

Comments

@christopherthielen
Copy link
Member

From @mentierd on April 11, 2018 21:6

When you call this.props.transition.router.stateService.reload(true), if the current state is a React component, the component is not "reloaded"; by that, I mean it does not unmount and remount the react component.

I've also tried the other approach of using transitionTo(..., null, {reload:true, notify:true}).

Maybe I'm missing something?

Copied from original issue: ui-router/react-hybrid#14

@christopherthielen
Copy link
Member Author

No, you're not missing anything. This is a limitation of the react ui-view. I'm moving this issue to the react issue tracker.

@christopherthielen
Copy link
Member Author

CC: @elboman

To be consistent with the other ui-router implementations, we should modify the ui-view so it unmounts/remounts the component when the state is exited/re-entered. If the user wants the component to remain mounted while parameter values change, they should use dynamic parameters.

We should also update @uirouter/core StateDeclaration and add a state-level dynamic flag to apply { dynamic: true } to all parameters for that state.

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

No branches or pull requests

1 participant