danielr18 / connected-next-router

A Redux binding for Next.js Router compatible with Next.js.
MIT License
109 stars 30 forks source link

Compatibility with react-redux@7 and next@9 #23

Closed typeofweb closed 5 years ago

typeofweb commented 5 years ago

Hi! Is this package compatible with react-redux@7 and next@9? Thank you :)

danielr18 commented 5 years ago

Yes, I'll be releasing a new version to fix the peer dependency warnings very soon.

adonig commented 5 years ago

Does react-redux@7 with next@9 really work? I followed the instructions in the README and get

index.js:1 Warning: Failed context type: The context `store` is marked as required in `WithConnectedRouter`, but its value is `undefined`.
    in WithConnectedRouter (at _app.js:36)
    in Provider (at _app.js:35)
    in Container (at _app.js:34)
    in MyApp (created by withRedux(MyApp))
    in withRedux(MyApp)
    in Suspense (created by AppContainer)
    in Container (created by AppContainer)
    in AppContainer
danielr18 commented 5 years ago

@adonig Are you using version 1? If version 1 isn't working, I'm sure 2.0.0-alpha.1 will, but I haven't documented that version yet.

shkarupa-alex commented 5 years ago

Same error and i don't see version 2.0.0-alpha.1 anywhere

typeofweb commented 5 years ago

@shkarupa-alex https://www.npmjs.com/package/connected-next-router/v/2.0.0-alpha.1

getorca commented 5 years ago

even with v2.0.0-alpha.1 I'm getting the Warning

Warning: Failed context type: The contextstoreis marked as required inComponent, but its value isundefined. in WithConnectedRouter (at _app.js:51) in Context.Provider in Provider (at _app.js:50) in Container (at _app.js:49) in MyApp in ConnectFunction in ConnectFunction in withRedux(Connect(MyApp)) in Context.Provider in Context.Provider in Context.Provider in Context.Provider in Context.Provider in AppContainer

danielr18 commented 5 years ago

I would need a minimal repro to check that, I don't get that warning in the example: https://github.com/danielr18/connected-next-router/tree/typescript/examples/basic

danielr18 commented 5 years ago

Example is also working with v1 of this library, Next.js 9 and react-redux 7, it's just that it has peer dependencies warnings. Do you have any chance of creating a repo where I can take a look or codesandbox?

danielr18 commented 5 years ago

However, WithConnectedRouter is only in v0 of the library, so you might not be using v2.0.0-alpha.1.

danielr18 commented 5 years ago

I've updated the latest tag in npm to point to 1.0.2, so if you are using react-redux 6 or 7, you can just npm i connected-next-router.

adonig commented 5 years ago

@danielr18 Version 1.0.2 works. Thank you 😊🙏