0

What is the problem here? May be for div?

import React, { Component } from 'react';
import './Home.css';

class Home extends Component {
    state = {

    }

    render() {
        return
        (
            <div>
                Home
            </div>
        )
    }
}
export default Home;

Error is: Expected an assignment or function call and instead saw an expression

Click here for the image

2 Answers2

2

Here is what's happening:

class Home extends Component {
    state = {

    }

    render() {
        return // Here you are returning and the function stops executing... as suggested in the comment bring up the ( on the same line as return...
        (
            <div>
                Home
            </div>
        )
    }
}
export default Home;
SakoBu
  • 3,448
  • 1
  • 11
  • 30
-1

Your file is saved as Home.js, so the compiler doesn't understand some of the syntax. Try saving as Home.jsx.

xDreamCoding
  • 1,494
  • 1
  • 11
  • 17