Giter Club home page Giter Club logo

Comments (8)

danielr18 avatar danielr18 commented on June 20, 2024

@dbrrt Hello, it's possible to use it.

It depends on what you want to do, you can dispatch Router methods from your sagas, or read the location state from the store.

Let me know if I can help you further

from connected-next-router.

dbrrt avatar dbrrt commented on June 20, 2024

@danielr18 Thanks for the quick reply, I've tried to wrap my main App with <Provider> and <ConnectedRouter>, but it had no effect when calling actions from the library. I'm using hooks in my functional components can it be an anti-pattern with your library?

from connected-next-router.

danielr18 avatar danielr18 commented on June 20, 2024

Are you using the redux middleware?

Here's v2 example: https://github.com/danielr18/connected-next-router/tree/v2/examples/basic

from connected-next-router.

dbrrt avatar dbrrt commented on June 20, 2024

Yes, but probably misconfigured. Will try again. Thanks for the link!

EDIT: Quickly adapted from the example your shared.
It works just fine with Saga.

Here's how I'm updating the route in my sagas in my generators.
yield put(push({ pathname: '/new-path'}))

Unfortunately I'm still having Server side rendering issues: Error: No router instance found. You should only use "next/router" inside the client side of your app.

from connected-next-router.

danielr18 avatar danielr18 commented on June 20, 2024

Are you dispatching a navigation action on the server side?

from connected-next-router.

dbrrt avatar dbrrt commented on June 20, 2024

That was the issue, performing the dispatch on the client side only resolved the problem

from connected-next-router.

dbrrt avatar dbrrt commented on June 20, 2024

Thanks a lot @danielr18, this issue can be closed, I can try to make a PR with an example for Saga once I've got a moment.

from connected-next-router.

danielr18 avatar danielr18 commented on June 20, 2024

@dbrrt That would be great, thanks!

from connected-next-router.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.