import React from 'react';
import './App.css';
import Sidebar from "./components/sidebar/Sidebar";
import Profile_page from "./components/profile_page/Main";
import Dialogs from "./components/dialogs/Dialogs"
import {BrowserRouter, Route} from "react-router-dom";
import Switch from "react-router-dom/es/Switch";
function App() {
return (
<BrowserRouter>
<div className="App">
<Sidebar></Sidebar>
<Switch>
<Route path="/dialogs" component={Dialogs}></Route>
<Route path="/profile" component={Profile_page}></Route>
</Switch>
</div>
</BrowserRouter>
);
}
export default App;
./node_modules/react-router-dom/modules/NavLink.js
SyntaxError: C:\Projects\react\my-app\node_modules\react-router-dom\modules\NavLink.js: Support for the experimental syntax 'jsx' isn't currently enabled (45:7):
43 | ) => {
44 | return (
> 45 | <RouterContext.Consumer>
| ^
46 | {context => {
47 | invariant(context, "You should not use <NavLink> outside a <Router>");
48 |
Add @babel/plugin-transform-react-jsx (https://git.io/vb4yd) to the 'plugins' section of your Babel config to enable transformation.