reactjs - make composed Link with react-router -


the problem when add composed link example

<route path="l1/l2" component={comp}/>

when navigating link app can't load resources public folder cause app loading resources example : http://localhost:8080/l1/bundle.js instead of http://localhost:8080/bundle.js guess it's problem in webpack configuration couldn't fix here webpack config :

    var config = {       devtool: 'eval-source-map',       entry:  __dirname + "/app/index.js",       output: {        path: __dirname + "/public",        filename: "bundle.js"      },      module: {      loaders: [{       test: /\.jsx?$/,       exclude: /node_modules/,       loader: 'babel',       query: {         presets: ['es2015','react']       }     }]    },    devserver: {     contentbase: "./public",     colors: true,     historyapifallback: true,     inline: true    } 

all appreciated thank in advance !

it's how load in bundle in index.html:

  • <script src="bundle.js"></script> relative current url.

  • <script src="/bundle.js"></script> relative root.

try second version, should work then.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -