Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

multiple routerWillLeave triggers #128

Closed
egadstar opened this issue Dec 18, 2015 · 8 comments
Closed

multiple routerWillLeave triggers #128

egadstar opened this issue Dec 18, 2015 · 8 comments

Comments

@egadstar
Copy link

When using redux-simple-router in conjunction with the router's routerWillLeave lifecycle method, the routerWillLeave method is called twice. I'm assuming this is related to #109 or #108?

@kimjoar
Copy link
Collaborator

kimjoar commented Dec 18, 2015

Hm, strange. Might be. I've got some busy days now before christmas so I don't have much time to check. If you want to test if #109 fixes your problem maybe you could test my branch in your app? That would be valuable input in ensuring we get this stuff right.

If so, you can add this to your package.json:

"redux-simple-router": "kjbekkelund/redux-simple-router#fix-double-update"

After npm install you have to cd node_modules/redux-simple-router and do a new npm install. This will build the lib, so you can use it in your app.

I'll also try to get this stuff tested more as soon as I've got some hours available.

@egadstar
Copy link
Author

No problem, I'll give it ago. Thanks.

@egadstar
Copy link
Author

Getting an error - "Uncaught SyntaxError: Unexpected token {" on this line -

function pushPath(path, state, { avoidRouterUpdate = false } = {}) {

I'll have to look into more later.

@kimjoar
Copy link
Collaborator

kimjoar commented Dec 18, 2015

No problem, @egadstar — I'll try to get this tested as soon as I've got a bit of time

@jlongster
Copy link
Member

@egadstar You probably didn't compile it, I think we have a problem when installing a custom branch where it doesn't compile the source. You can try to compile it by going into the folder and running npm run build.

@kimjoar
Copy link
Collaborator

kimjoar commented Dec 18, 2015

Haha, oups, forgot to include the build step above :/ Sorry, @egadstar. I need to write this down so I can copy/paste

@egadstar
Copy link
Author

I had to change the build script to mkdir -p lib && babel ./src/index.js --presets=es2015 --out-file ./lib/index.js to get it to compile correctly, but I got it to build and the branch looks to have resolved the issue. Thanks.

@kimjoar
Copy link
Collaborator

kimjoar commented Dec 19, 2015

Thanks for checking that out, @egadstar. Will try to get a fix released soon :)

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

No branches or pull requests

3 participants