FlowRouter.replace I stead of go

Is there a replace method in FlowRouter? I need to change the location without creating a new history entry. Without a router I’d use history.replaceState, and am looking for something like that (page.js seems to use context.save).

Yep!

Awesome! This worked:

FlowRouter.withReplaceState(() => FlowRouter.go('/path'))

I have an additional problem though. I have been using a colon : as a secondary fragment separator, but when I try to set a URL with that in there, it seems to screw up the resulting location, removing colon and the fragment before it. Any idea why that might be - or a suggestion for an alternative separator?

That I don’t know. I saw you opened an issue on kadirahq:flow-router – you may find a better response if you post here: https://github.com/VeliovGroup/flow-router/issues?utf8=✓&q=is%3Aissue

I’ve never used a colon in my urls, so I can’t speak on that, but in flow-router’s path definition, a colon typically precedes a param, so that could be tripping things up?

That’s what I figured - though it shouldn’t, logically speaking. Path definition and path contents are two different things.

1 Like

That’s a different package than I’m using - has the kadira package been abandoned?

Yeah, there are a few people maintaining forks now – not sure about which is most active, etc.