Giter Site home page Giter Site logo

Comments (7)

dvdzkwsk avatar dvdzkwsk commented on March 29, 2024 3

@zoilorys sorry for the spam lol, but I just added a publicPath option in the webpack client configuration and it appears to have fixed the issue. Either pull the latest master or add it yourself... hopefully this solves your problem!

// ~/build/webpack/client/index.js
const config = makeConfig({
  name   : 'Client',
  target : 'web',
  entry  : {
    app : [
      projectConfig.inSrc('entry-points/client')
    ],
    vendor : projectConfig.VENDOR_DEPENDENCIES
  },
  output : {
    filename : '[name].[hash].js',
    path     : projectConfig.inDist('client'),
    publicPath : '/' // ADD THIS
  }
});

from react-redux-starter-kit.

dvdzkwsk avatar dvdzkwsk commented on March 29, 2024

Not sure just yet if this is a problem with the starter kit or react-router or some combination, but I've reproduced it and am looking into it.

Going to link to your issue on react-router while this is troubleshooted: remix-run/react-router#1682 ... seems like it might be a problem with their 1.0.0 version, as there are a few related issues open in their repo.

from react-redux-starter-kit.

zoilorys avatar zoilorys commented on March 29, 2024

@davezuko , yeah i guess so. I think ill try to replace current router with 0.13 and try to work with it until it will be resolved. Thank you :)

from react-redux-starter-kit.

dvdzkwsk avatar dvdzkwsk commented on March 29, 2024

@zoilorys Ok, hopefully that works. I experimented with removing the <Provider> that we have to wrap the <Router> in but had no success. I'm not doing anything else special with the routes so I'm pretty convinced it's a bug with react-router, sadly. I'll ping you if I manage to get it working.

Going to leave this ticket open in the meantime in case someone happens to have an idea.

from react-redux-starter-kit.

zoilorys avatar zoilorys commented on March 29, 2024

@davezuko , ok, thanks again) Yeah i will post here if swapping router version helps, then i guess it will be obvious whats the problem.

from react-redux-starter-kit.

dvdzkwsk avatar dvdzkwsk commented on March 29, 2024

@zoilorys I changed the history that's passed to the Router from BrowserHistory to HashHistory and it works... so now on to see why this is the case. But you could use that as an alternative for now.

In the starter-kit, this is in ~/src/entry-points/client.js

This is my route structure

export default (
  <Route component={CoreLayout}>
    <Route name='home' path='/' component={HomeView} />
    <Route name='user' path='/user' component={UserView}>
      <Route path='/:id' component={ProfileView} />
    </Route>
    <Route name='about' path='/about' component={AboutView} />
  </Route>
);

Then:

// views/user/profile/index.jsx
import React from 'react';

export default class ProfileView extends React.Component {
  constructor () {
    super();
  }

  render () {
    return (
      <div>
        <h2>Profile {this.props.params.id}!</h2>
      </div>
    );
  }
}

// views/user/index.jsx
import React from 'react';

export default class UserView extends React.Component {
  constructor () {
    super();
  }

  render () {    
    return (
      <div>
        <h1>User View!</h1>
        {this.props.children}
      </div>
    );
  }
}

from react-redux-starter-kit.

dvdzkwsk avatar dvdzkwsk commented on March 29, 2024

Also might want to check this out: remix-run/react-router#676

from react-redux-starter-kit.

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.