Home > Software design >  I cannot find the error and it shows like this 'Error in ./src/App.js Syntax error: Unexpected
I cannot find the error and it shows like this 'Error in ./src/App.js Syntax error: Unexpected

Time:04-14

This is my error

Error in ./src/App.js Syntax error: Unexpected token (11:5)

9 | 10 | return (

11 | <> | ^ 12 |
13 | 14 |

@ ./src/index.js 13:11-27

Here is my app.js file

import React from 'react';
import { CssBaseline, Grid } from '@material-ui/core';

import Header from './components/Header/Header';
import List from './components/List/List';
import Map from './components/Map/Map';

const App = () => {

  return (
    <>
   
        <CssBaseline/>
        <Header />
        <Grid container spacing={3} style={{ width: '100%'}}>
            <Grid item xs={12} md={4}>
              <List />
            </Grid>
            <Grid item xs={12} md={8}>
              <Map />
            </Grid>
        </Grid>

    </>
  );
}

export default App;

it is my app.js file

CodePudding user response:

Use React.Fragment instead of <>.

I would think your babel plugin doesn't understand <></> because of old version.

  • Related