I am working on some dummy project in REACT js, and while following certain tutorials I am errors which I am not able to rectify, Below is the error:
Failed to compile
./src/index.js
SyntaxError: E:REACT_APPdrf_projectsrcindex.js: Unexpected token, expected ";" (10:6)
8 | import Footers from './components/Footers';
9 |
> 10 | Const routing = (
| ^
11 | <Router>
12 | <React.StrictMode>
13 | <Header />
This error occurred during the build time and cannot be dismissed.
Below is the index.js
import React from 'react';
import ReactDOM from 'react-dom';
import * as serviceWorker from './serviceWorker';
import './index.css';
import { Route, BrowserRouter as Router, Switch } from 'react-router-dom';
import App from './App';
import Header from './components/Header';
import Footers from './components/Footers';
Const routing = (
<Router>
<React.StrictMode>
<Header />
<Switch>
<Route exact path='/' component={App} />
<Switch>
<Footer />
</React.StrictMode>
</Router>
);
ReactDOM.render(routing, document.getElementById('root'));
serviceWorker.unregister();
Based on the error, I have tried looking again and again but no success. Please suggest.
question from:
https://stackoverflow.com/questions/65901067/why-am-i-getting-syntax-error-for-react-project 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…