score:0

Accepted answer
import {Router, Route, browserHistory , hashHistory, IndexRoute , useRouterHistory  } from 'react-router';
import { createHistory } from 'history'

const appHistory = useRouterHistory(createHistory)({
  basename: "/demos/v1"
});
render(
    <Provider store={window.store}>
        <Router history={appHistory}>
            <Route path="/" component={App}>
                <IndexRoute component={BoxMessage} />
                <Route path="/profile" component={MyProfile} >
                    <Route path="/profile/:id" component={MyProfile}/>
                    <Route path="/profile/:id/:fisrt_name" component={MyProfile}/>
                    <Route path="/profile/:id/:fisrt_name/:last_name" component={MyProfile}/>
                    <Route path="/profile/:id/:fisrt_name/:last_name/:avatar" component={MyProfile}/>
                 </Route>
            </Route>
        </Router>
    </Provider> 
    ,
    document.getElementById('root')
) 

score:0

import {Router, Route, browserHistory , hashHistory, IndexRoute} from 'react-router';

class App extends React.Component{

    constructor(props) {

        super(props);
    }

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

render(
    <Provider store={window.store}>
        <Router history={browserHistory}>
            <Route path="/" component={App}>
                <IndexRoute component={BoxMessage} />
                <Route path="/profile" component={MyProfile} />
            </Route>
        </Router>
    </Provider> 
    ,
    document.getElementById('root')
)

score:1

<IndexRoute component={App}/>

Related Query

More Query from same tag