React Router Params not working

Viewed 968

I am trying to use params in my react redux application, but unfortunately its not working. I am getting a blank screen. Here is the code which i am following

import React from 'react';
import ReactDOM from 'react-dom';
import {Router, Route, browserHistory} from 'react-router';
import thunk from 'redux-thunk';
import rootReducer from './rootReducer';
import { createStore, applyMiddleware, compose } from 'redux';

 const store = createStore(
 rootReducer,
 compose(
   applyMiddleware(thunk),
   window.devToolsExtension ? window.devToolsExtension() : f => f
 )
);
ReactDOM.render(
<Provider store={store}>
<Router history={browserHistory}>
  <Route path="/" component={Login}/>
  <Route path="/lists" component={requireAuth(Dashboard)}/>
  {/* Parameter route*/}
  <Route path="/record/:mEID" component={requireAuth(Record)}/>
</Router>
</Provider>,
document.getElementById('root')
);

When i go to my localhost url i.e. localhost:3000/record/16655 then i am getting error like this "http://localhost:3000/record/index.js is not found".

What could be the solution for this???

Here is my package.json for reference

 "lodash": "^4.17.4",
 "prop-types": "^15.5.10",
"react": "^15.1.0",
"react-bootstrap": "^0.31.0",
"react-bootstrap-table": "^3.3.7",
"react-dom": "^15.1.0",
"react-fontawesome": "^1.6.1",
"react-redux": "^4.4.5",
"react-router": "^3.0.2",
"redux": "^3.5.2",
"redux-thunk": "^2.1.0",
1 Answers
Related