Today i come up with a strange issue for my react application.In the browser i can see the following error message.
Warning: Automatically setting basename using <base href> is deprecated and will be removed in the next major release. The semantics of <base href> are subtly different from basename. Please pass the basename explicitly in the options to createHistory
In the index.html i have added <base href="/">
which causes the error message.
I have the index.jsx as follows:
import React from 'react';
import {render} from 'react-dom';
import {Router, Route, IndexRoute, browserHistory, Redirect} from 'react-router';
import {Provider} from 'react-redux';
import Layout from './components/layout/layout.jsx'
import HomePageContainer from './containers/homePageContainer.jsx'
import SearchPageContainer from './containers/searchPageContainer.jsx'
import configureStore from './store/configureStore.jsx'
import BroadcastDetailContainer from './containers/broadcastDetailContainer.jsx'
const store = configureStore();
render
(
<Provider store={store}>
<Router history={browserHistory}>
<Route component={Layout}>
<Redirect from='/' to='/home'/>
<Route path="/home" component={HomePageContainer}/>
<Route path="/search" component={SearchPageContainer}/>
<Route path="/broadcast/:broadcastId" component={BroadcastDetailContainer}/>
</Route>
</Router>
</Provider>,
document.getElementById('container')
);
I tried some methods and which is not working. If remove <base href>
the error will go but the detail pages or the images will not be show due to the path issue.