Code Monkey home page Code Monkey logo

Comments (9)

kirill-konshin avatar kirill-konshin commented on May 22, 2024

Can you provide some code to reproduce the error?

from next-redux-wrapper.

rohmanhm avatar rohmanhm commented on May 22, 2024

https://github.com/zeit/next.js/tree/master/examples/with-redux

inside pages/index.js console log this.props in render. It should show this.props object contains url key.

The correct example: https://github.com/zeit/next.js/blob/master/examples/with-shallow-routing/pages/index.js
this.props always contains url.

References:
https://github.com/zeit/next.js#routing

Each top-level component receives a url property with the following API:

from next-redux-wrapper.

kirill-konshin avatar kirill-konshin commented on May 22, 2024

I cannot reproduce it, url property is received as expected: https://github.com/kirill-konshin/next-redux-wrapper/blob/master/pages/other.js#L6

from next-redux-wrapper.

glrodasz avatar glrodasz commented on May 22, 2024

Hey, I'm having the same problem when I use withRedux() it is removing the url prop.

from next-redux-wrapper.

rohmanhm avatar rohmanhm commented on May 22, 2024

@glrodasz For a while, I fixed my issue by switch to next-connect-redux

from next-redux-wrapper.

glrodasz avatar glrodasz commented on May 22, 2024

@rohmanhm I just need the query at the moment so I found a workaround. You can get the query from the context object in getInitialProps.

import React, { Component } from 'react'
import withRedux from 'next-redux-wrapper'
import initStore from '../redux/store'
import ListPage from '../components/ListPage'

class Index extends Component {
  static getInitialProps (context) {
    return {
      query: context.query
    }
  }

  render () {
    return <ListPage {...this.props} />
  }
}

export default withRedux(initStore)(Index)

from next-redux-wrapper.

kirill-konshin avatar kirill-konshin commented on May 22, 2024

First of all, please try version 1.1.1. Second, please look at the example https://github.com/kirill-konshin/next-redux-wrapper/blob/master/pages/other.js - is this what you guys expect?

from next-redux-wrapper.

kirill-konshin avatar kirill-konshin commented on May 22, 2024

Can somebody create a reproducible example and put it in gist or a fork so that I can fix it?

from next-redux-wrapper.

glrodasz avatar glrodasz commented on May 22, 2024

@kirill-konshin @rohmanhm Looks like it is working now with the 1.1.1 version. 👍
Thank you so much!

from next-redux-wrapper.

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.