kadirahq / flow-router

Carefully Designed Client Side Router for Meteor
MIT License
1.09k stars 195 forks source link

"Path" not change in loop of FlowRouter.go() #744

Open beobungbu opened 2 years ago

beobungbu commented 2 years ago

let's say I have 2 Routes:

FlowRouter.route('/konnichiha', {
    name: 'konnichiha',
    triggersEnter(){
        FlowRouter.go('sayonara');
    },
});

and

FlowRouter.route('/sayonara', {
    name: 'sayonara',
    action(){
        BlazeLayout.render('main', { center: 'home' });
    },
});

at somewhere in the Application, when the user hit "konnichiha" button, then it's invoked: FlowRouter.go('konnichiha'); then the URL appears on the browser turn to https://domain.com/konnichiha, then its content changes to layout of "main" template, but the URL path still appears as https://domain.com/konnichiha, I think it should be https://domain.com/sayonara instead. I'm looking on the readme but have not found any way to change the path manually without reloading the page. I think this is a bug of FlowRouter.

beobungbu commented 2 years ago

I also tried to change from :

FlowRouter.route('/konnichiha', {
    name: 'konnichiha',
    triggersEnter(){
        FlowRouter.go('sayonara');
    },
});

to

FlowRouter.route('/konnichiha', {
    name: 'konnichiha',
    action(){
        FlowRouter.go('sayonara');
    },
});

and:

FlowRouter.route('/konnichiha', {
    name: 'konnichiha',
    triggersExit(){
        FlowRouter.go('sayonara');
    },
});

but no luck.

dr-dimitru commented 2 years ago

@beobungbu can you reproduce it using ostrio:flow-router-extra?