Я новичок в реакции и пытаюсь создать приложение с подстраницами. Нет проблем с тем, что я это сделал, но одной маленькой проблемой является моя ссылка " localhost: 3000 / ", преобразованная в " локальный: 3000 / # /"
Вот мой код:
App.js
import React, { Component } from 'react';
import Header from './layouts/header.js';
import Footer from './layouts/footer.js';
import Sidebar from './layouts/sidebar.js';
import './css/style.scss';
const App = (props) => {
return (
<div>
<div className="sideBar">
<Sidebar />
</div>
<div className="main_container">
<Header />
{props.children}
<Footer />
</div>
</div>
);
}
export default App;
routes.js
import React from 'react';
import { IndexRoute } from 'react-router';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
/**
* Import all page components here
*/
import App from './App.js';
import MainPage from './pages/homepage.js';
import About from './pages/about.js';
/**
* All routes go here.
* Don't forget to import the components above after adding new route.*/
export default (
<Route path="/" component={App}>
<IndexRoute component={MainPage} />
<Route path="/about/:id" component={About} />
</Route>
);