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
On refresh browser page, this hook return empty state, instead of my correct state: {"name":"","url":"^","views":null,"params":{"#":{"value":null,"type":"hash","dynamic":true}},"abstract":true}.
But router.transitionService.onSuccess called with my correct state.
exportconstuseCurrentStateAndParams=()=>{constglobals=useRouter().globals;const[stateData,setStateData]=useState({state: globals.current,params: globals.params});router.transitionService.onSuccess({},(transition)=>{// Reacting with my correct stateconsole.log('onSuccess');setStateData({state: transition.to(),params: transition.params('to')});});useOnStateChanged((state,params)=>{// Reacting with empty stateconsole.log('useOnStateChanged');setStateData({ state, params });});returnstateData;};
The text was updated successfully, but these errors were encountered:
On refresh browser page, this hook return empty state, instead of my correct state:
{"name":"","url":"^","views":null,"params":{"#":{"value":null,"type":"hash","dynamic":true}},"abstract":true}
.But
router.transitionService.onSuccess
called with my correct state.The text was updated successfully, but these errors were encountered: