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

How does the RouterContainer work? #28

Open
sergonius opened this issue Dec 17, 2015 · 2 comments
Open

How does the RouterContainer work? #28

sergonius opened this issue Dec 17, 2015 · 2 comments

Comments

@sergonius
Copy link

I am implementing this thing piece by piece into an application and I am getting "Cannot read property 'getCurrentQuery' of null".
I went to see the RouterContainer service and it doesn't seem to have a lot in there.
What is this sorcery?

@ydogandjiev
Copy link

I hit this issue too; it's because router-server has undergone a number of breaking changes since the version used in the tutorial. Check out my implementation here to see how it works now:
https://github.com/ydogandjiev/runthistown-client

Steps:

  1. Create a simple browserHistory module to encapsulate the history singleton (I chose to put it under services):
    https://github.com/ydogandjiev/runthistown-client/blob/master/src/services/browserHistory.js
  2. In your module.js pass the history singleton to your Router:
    import History from 'services/browserHistory';
    render(({routes}), document.getElementById('content'));
  3. When you want to trigger a navigation from anywhere in your code (in this case from an action) just write this:
    import History from 'services/browserHistory';
    History.push('/');

@pedramsaleh
Copy link

@ydogandjiev Your link to your implementation above gives a 404.

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

3 participants